Hello,
I searched almost all the web in order to find out why my .tif is converted to .jpg with wrong colors..
I tried many solutions that worked for others but not for me..
One of the latest commands I tried is the following (I 've tried several ones).
convert -profile img_profiles/CMYK/USWebUncoated.icc -profile img_profiles/RGB/sRGB.icc mytif.tif dest.jpg
here is the link for the .tif and .jpg files
http://makis.partyreports.com/mytif.tif
http://makis.partyreports.com/dest.jpg
I spent 2 days trying on finding a way to solve this with no luck..
The system is (Debian 4.4.5-8)
ImageMagick 6.6.0.4
Thank you!
Yet another tif to jpg conversion with wrong colors..
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Yet another tif to jpg conversion with wrong colors..
I suspect it has something to do the with the jpg compression used. This gets somewhat close but it not close enough. I am not sure why the -negate is needed, but again I think it has to do with the jpg compression.
Code: Select all
convert mytif.tif -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/sRGB.icc -negate mytif.jpg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Yet another tif to jpg conversion with wrong colors..
If I open the file in PS and change the compression from JPEG to LZW and save as mytif2.tif then the following works perfectly fine.
So my suspicion is correct. I am not sure why IM has trouble with CMYK TIFF images with JPEG compression. It may be a bug. But the IM developers will need to check this out. Perhaps one needs some special addition to libtiff or libjpeg?
Code: Select all
convert mytif2.tif -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/sRGB.icc mytif2.jpg
Re: Yet another tif to jpg conversion with wrong colors..
Thank you very much for your answers!
Is there any way to change the compression in the tif file with image magick before convert it to jpg?
Thanks!
Is there any way to change the compression in the tif file with image magick before convert it to jpg?
Thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Yet another tif to jpg conversion with wrong colors..
I tried, but that did not seem to help. It seems that IM cannot handle properly the jpg compressed cmyk tiff. So when it reads it to change the compression it improperly handles it.mmx wrote:Thank you very much for your answers!
Is there any way to change the compression in the tif file with image magick before convert it to jpg?
Thanks!
Neither of these work:
Code: Select all
convert mytif.tif -compress LZW -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/sRGB.icc mytif1.jpg
convert mytif.tif -compress LZW TIFF:- | convert - -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc -profile /Users/fred/images/profiles/sRGB.icc mytif1.jpg
Re: Yet another tif to jpg conversion with wrong colors..
Thanks fmw42!
So in other words you would suggest me to look for another solution and leave imagemagick behind?
Can I ask for any suggestion?
Let me give you some details about what I am trying to do so you can come up with some ideas..
I have several people uploading to a server tif images like this one (I think they extract the images from pdf files by using tifflib).
Then I want to convert all of them in jpg so I can later present them in HTML pages..
I thought it was trying to something fairly simple but it turned out that is not simple at all!
Thanks again!
So in other words you would suggest me to look for another solution and leave imagemagick behind?
Can I ask for any suggestion?
Let me give you some details about what I am trying to do so you can come up with some ideas..
I have several people uploading to a server tif images like this one (I think they extract the images from pdf files by using tifflib).
Then I want to convert all of them in jpg so I can later present them in HTML pages..
I thought it was trying to something fairly simple but it turned out that is not simple at all!
Thanks again!
Re: Yet another tif to jpg conversion with wrong colors..
Thanks guys!
I will report it as a "possible" bug..
So far the solution for me is to do it by calling a python script..
Thanks all for your help!
I will report it as a "possible" bug..
So far the solution for me is to do it by calling a python script..
Thanks all for your help!