Imagemagick ignores pixel resolution in TIFF-images
Posted: 2006-09-02T04:54:11-07:00
Have a look at this TIFF-image:
http://fkurth.de/uwest/usti/TESTB.TIF
It is a SEM image that shows a round hole and has 512x512 pixels.
But the pixel resolution in x- and y-direction is different:
x-direction: 84.211 dpi
y-direction: 107.789 dpi
(ratio of y/x is exactly 1.28 )
The resolutions are stored in the TIFF header and are conform to the TIFF definition. But Imagemagick doesn't take about this and displays and converts the image as if both directions would have the same resolution. The result is a squeezed image, convert it for example to PNG and you'll see that the shown round hole becomes oval.
When Imagemagick converts TIFF-images it should take care of the resolutions and if the target image format cannot handle different resolutions it should automatically recalculate the image, in this case to 512x655 pixels.
The built in image viewer of WinXP for example does this job correctly.
http://fkurth.de/uwest/usti/TESTB.TIF
It is a SEM image that shows a round hole and has 512x512 pixels.
But the pixel resolution in x- and y-direction is different:
x-direction: 84.211 dpi
y-direction: 107.789 dpi
(ratio of y/x is exactly 1.28 )
The resolutions are stored in the TIFF header and are conform to the TIFF definition. But Imagemagick doesn't take about this and displays and converts the image as if both directions would have the same resolution. The result is a squeezed image, convert it for example to PNG and you'll see that the shown round hole becomes oval.
When Imagemagick converts TIFF-images it should take care of the resolutions and if the target image format cannot handle different resolutions it should automatically recalculate the image, in this case to 512x655 pixels.
The built in image viewer of WinXP for example does this job correctly.