Converting TIFF into PNG - Colour problems

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
GavW
Posts: 2
Joined: 2013-03-19T09:16:22-07:00
Authentication code: 6789

Converting TIFF into PNG - Colour problems

Post by GavW »

Hi guys,

I have a large amount of high resolution TIFF images which I need to batch convert into transparent PNG images. As it stands I've managed to convert, resize and significantly reduce the image file size quite successfully. The only problem I'm having is the difference in the image colour. I'm running the following code in my PHP script:

Code: Select all

exec($command = "$convert \"tiffImage.tif\" -background transparent -density 72 -resize 15x15% \"newImage.png\"", $output, $retval);
Hopefully you can see what I'm attempting to achieve. I've also attempted using the colorspace option but to no avail. The colours returned in the PNG are a lot paler than in the original TIFF image and don't represent the original image very well. I've also attempted to do something similar converting to a JPEG but that has the opposite effect as the colours seem to get a lot brighter.

Hopefully someone with a lot more know how than myself will be able to point me in the right direction.

Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Converting TIFF into PNG - Colour problems

Post by snibgo »

Are your tiff files sRGB? CMYK? Do they contain color profiles?
snibgo's IM pages: im.snibgo.com
GavW
Posts: 2
Joined: 2013-03-19T09:16:22-07:00
Authentication code: 6789

Re: Converting TIFF into PNG - Colour problems

Post by GavW »

The TIFF files are in CMYK format.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting TIFF into PNG - Colour problems

Post by fmw42 »

I do not believe that PNG supports CMYK. So you will need to convert to sRGB either by -colorspace sRGB or using -profile with the appropriate profiles for CMYK (used in the TIFF) and sRGB.
Post Reply