Page 1 of 1

TIF to JPG, DPI and Clipping Path

Posted: 2012-03-22T11:22:20-07:00
by eafalcao
Hi...

I don't know if this is really a bug... however, here it goes:

I have the fowling image that I need to change dpi's, convert to jpg, and the width and heigth must remain as well as the clipping path: http://bayfiles.com/file/5Y0T/BStLBq/tif1.tif

I'm doing this:

Code: Select all

convert tif1.tif -resample 150x150 -resize 952x3424 tif_result_1.jpg
or

Code: Select all

convert tif1.tif -density 150 tif1_150.jpg
But when I see the Windows properties of the result images, the dpis remains 300 (like the original). The same thing happens when i open the image in Photoshop.
If I use -strip option, as i've read in some posts, the dpis is shown correctly... however the image lose the clipping path.

This only happens when i try to convert tif to jpg. If i convert jpg in tif everything goes well.

So, it's a bug or I'm doing something wrong?

Thanks

Re: TIF to JPG, DPI and Clipping Path

Posted: 2012-03-22T14:48:57-07:00
by fmw42
I can confirm on IM 6.7.6.1 Q16 that the image starts with 300 dpi according to the verbose info for resolution. then

convert tif1.tif -density 150 tif1_150.jpg

in IM, the verbose info show resolution of 150 dpi, but when you open the file in PS it shows 300 dpi.

Furthermore, when saving to tiff

convert tif1.tif -density 150 tif1_150.tif

IM verbose info still shows 300 dpi for the resolution of the output tif.

Re: TIF to JPG, DPI and Clipping Path

Posted: 2012-03-26T02:08:35-07:00
by eafalcao
Does it only happens to me and to fmw42?

Re: TIF to JPG, DPI and Clipping Path

Posted: 2012-03-26T18:39:22-07:00
by anthony
Photoshop (PS) does not use the 'offical' resolution or density of an image, if it sees its photoshop profile extension!

IM does not touch photoshop extensions, so if an image has one changing its resolution does not change the one used by photoshop. :-( Best idea strip that profile using +profile 8bim

See Basics, Density, Photoshop and Density
http://www.imagemagick.org/Usage/basics ... _photoshop

This is also pointed to from the TIFF common file format notes
http://www.imagemagick.org/Usage/formats/#tiff

Re: TIF to JPG, DPI and Clipping Path

Posted: 2012-03-27T02:08:52-07:00
by eafalcao
Hi anthony... thank's for the answer.

However... by using "+profile 8bim" the result is simmilar when using "-strip": the resolution is changed, but the Clipping Path is lost. The original image has Clipping Path, and it's really important that it remains.

It seems that in my case, I simply cannot strip all the Photoshop profile because the Clipping Path is part of that profile.

And now?

Re: TIF to JPG, DPI and Clipping Path

Posted: 2012-03-27T10:04:42-07:00
by fmw42
You may be able to save profiles to a file by using -write photoshop.8bim, but I am not sure whether IM can put them back. You might look into EXIFTOOL, but I am not an expert on that and have not tried that. It may also be possible that EXIFTOOL (or some other non-IM tool) will be able to delete the density from the PS info leaving the clipping path.

Re: TIF to JPG, DPI and Clipping Path

Posted: 2012-03-27T16:48:51-07:00
by fmw42
From a PM between Anthony and myself:
anthony wrote:You can save profiles -write photoshop.8bim or at least that is my understanding.

But how would you put them back? Is there some way with or without IM? EXIFTOOL perhaps?

Code: Select all

 convert image   -profile 8BIM:photoshop.8bim  save_image
See the opening part of Profiles in IM examples
http://www.imagemagick.org/Usage/formats/#profiles

Profiles in IM is generally just treated as a data 'blob', which is just copied or transfered 'as is'.