Converting TIFF to Another TIFF

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
samueln.cepha

Converting TIFF to Another TIFF

Post by samueln.cepha »

Hi ALL,

I have a tif file, i want to convert these files to another tif file with difference resolution.

Following is the command i tried, but i am not able to get the extract result. I am cross-checking these images using Photoshop

convert c:\gkq346f7.tif -quality 100 -density 300x300 c:\gkq346\Graphics\Color\gkq346f7a.tif

The original tif image is 600 dpi, i want to convert to 300 dpi

C:\>convert -version
Version: ImageMagick 6.6.1-6 2010-04-23 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features:

Can anyone help
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting TIFF to Another TIFF

Post by fmw42 »

try adding -units pixelsperinch

what does

identify -verbose c:\gkq346\Graphics\Color\gkq346f7a.tif

tell you the density is?

can you post a link to your input tif?
samueln.cepha

Re: Converting TIFF to Another TIFF

Post by samueln.cepha »

I tried using the following command line arguement, but still the same result:

convert c:\gkq346f7.tif -units PixelsPerInch -density 300x300 -quality 100 d:\gkq346f7.tif

Following is the link where the files are available.

http://www.4shared.com/photo/1km6F3WZ/gkq346f7.html
http://www.4shared.com/photo/z3p5AKGc/O ... 346f7.html

And i tried using
identify -verbose c:\gkq346\Graphics\Color\gkq346f7a.tif

Following is the information i got from the file

Format: TIFF (Tagged Image File Format)
Class: DirectClass
Geometry: 3000x1336+0+0
Resolution: 600x600
Print size: 5x2.22667
Units: PixelsPerInch
Type: Grayscale
Base type: Grayscale
Endianess: MSB
Colorspace: RGB
Depth: 8-bit
Channel depth:
gray: 8-bit

Help me out what needs to done here

Thanks
Sam
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting TIFF to Another TIFF

Post by fmw42 »

your tif image has profiles, one of the profiles has some control over the resolution. if you strip the profiles then the density changes.

convert gkq346f7.tif -strip -density 300x300 gkq346f7b.tif

works fine for me. otherwise, without the -strip, I get your same results of density 600x600.

you can try to remove the offending profile with +profile. see http://www.imagemagick.org/Usage/formats/#profiles
Drarakel
Posts: 547
Joined: 2010-04-07T12:36:59-07:00
Authentication code: 8675308

Re: Converting TIFF to Another TIFF

Post by Drarakel »

Actually, ImageMagick does change some values. For example, IrfanView shows 600dpi for your original file and 300dpi for the IM output. But the values of the various profiles are not updated. And for Photoshop and also identify, the values in these profiles 'count more'.

In your case, with 'convert gkq346f7.tif -units PixelsPerInch -density 300 +profile "8bim,xmp" gkq346f7_2.tif', it should display the correct value in all programs.
Alternative: You could use ExifTool - as this is able to update the various tags (and also updates the normal header value). And it's lossless, so it's good for updating the values in a JPG, for example.

But with that TIF, just stripping the profiles indeed would be better (as the old data for width, height, colorspace etc. is not really consistent there :wink:).
samueln.cepha

Re: Converting TIFF to Another TIFF

Post by samueln.cepha »

Hi ALL,

Thank you for all your help.

After using -strip it is working perfectly

Once again thanks

Thanks
Sam
Post Reply