[Image-SIG] TIFF and units

Scott Pierce patrickspierce at yahoo.com
Fri Oct 22 20:53:15 CEST 2004


Can anyone tell me how to set the resolution unit when saving a tiff?  I 
set the dpi but it is unitless so doesn't register the dpi properly.  I 
am using the 1.5 alpha release as I couldn't set dpi at all prior to 1.5.

I set the dpi like so:
orig.save('/tmp/orig.tif',dpi=(300,300))
but haven't figured out how to get the unit correct.

Here is the original files info:
TIFF Directory at offset 0x8
  Subfile Type: (0 = 0x0)
  Image Width: 1359 Image Length: 1355
  *Resolution: 300, 300 pixels/inch*
  Bits/Sample: 8
  Compression Scheme: None
  Photometric Interpretation: min-is-black
  Samples/Pixel: 1
  Rows/Strip: 753
  Planar Configuration: single image plane

and the saved one:
TIFF Directory at offset 0x8
  Image Width: 1359 Image Length: 1355
*  Resolution: 300, 300 (unitless)*
  Bits/Sample: 8
  Compression Scheme: None
  Photometric Interpretation: min-is-black
  Rows/Strip: 1355
  Planar Configuration: single image plane

Scott Pierce



More information about the Image-SIG mailing list