Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When printing an image, what determines how large it will appear on a page?

Using Python's Imaging Library I want to create a PNG file.
I would like it if when printing this image, without any scaling, it would always print at a known and consistent 'size' on the printed page.

Is the resolution encoded in the image?

If so, how do I specify it?

And even if it is, does this have any relevance when it goes to the printer?

like image 706
carrier Avatar asked Jan 23 '09 16:01

carrier


People also ask

How do you know what size an image will print?

Divide the length of the photo in pixels, by the size you want to print it in in inches to find the ppi. For example, if you have a photograph that is 1800 pixels x 1200 pixels you can print it at 6” x 4” and have a high quality print as you'll be printing at 300ppi.

Do pixels determine the size of the image on the screen or in print?

If an image is 4500 x 3000 pixels it means that it will print at 15 x 10 inches if you set the resolution to 300 dpi, but it will be 62.5 x 41.6 inches at 72 dpi. While the size of your print does change, you are not resizing your photo (image file), you are just reorganizing the existing pixels.

How do I make an image fit the page to print?

Start by choosing "File" and then "Print," and clicking the "Position and Size" settings. Usually, the default option is "Scale to Fit Media," which prints to the page margins. Deselect it, then manually enter scale, height and width values that equal the full size of your paper. Click "Print" to print your image.

How do I know if a photo is big enough to print?

The best way to know if your image is good for printing is by using a photo editing software like photoshop. Look your image settings and make sure that the resolution is at least 300 pixels per inch at the final size that it will be used.


1 Answers

As of PIL 1.1.5, there is a way to get the DPI:

im = ... # get image into PIL image instance
dpi = im.info["dpi"] # retrive the DPI
print dpi # (x-res, y-res)
im.info["dpi"] = new dpi # (x-res, y-res)
im.save("PNG") # uses the new DPI
like image 128
kylebrooks Avatar answered Nov 14 '22 22:11

kylebrooks