PIL: retreive image resolution (dpi)

Terry Reedy tjreedy at udel.edu
Mon Aug 22 13:54:39 EDT 2005


<and-google at doxdesk.com> wrote in message 
news:1124709169.824131.49120 at g44g2000cwa.googlegroups.com...
> AlexGreif.2609394 at bloglines.com wrote:
>
>> I looked at the PIL Image class but cannot see a posibility to retreive
>> the image resolution dots per inch (or pixels per inch)
>
> Not all formats provide a DPI value; since PIL doesn't do anything with
> DPI it's not part of the main interface.

Digital images intrinsically have a size in pixels, not a 'resolution'. 
Resolutions (dpi or whatever) represent relationships and transformations 
between images and physical substrates.  Somes images have an input 
transform, though for digital cameras, the input dpi or dpm(illimeter) of 
the ccd imager is seldom useful.  Some have one *or more* output 
transforms.  Some have both.  So I think the option i/o transforms are best 
thought of and kept as 'extra' data.  (The same applies to strings and I/O 
formats.)

Terry J. Reedy


Terry J. Reedy






More information about the Python-list mailing list