convert PNG to PDF: color issues

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
areslagae
Posts: 5
Joined: 2012-02-08T02:30:49-07:00
Authentication code: 8675308

convert PNG to PDF: color issues

Post by areslagae »

Hi all,

I am converting a PNG to a PDF using

convert image.png -units PixelsPerInch -density 300 image.pdf

However, the colors in the PNG file are way off (gamma and color balance) when looking at both the PNG and the PDF on the screen (I have not tried printing the PDF yet).

How can I fix this?

It seems that adding the "-colorspace CMYK" option makes things much better (sRGB and RGB do not) but I do not know if that is the appropriate way to solve the problem.

There does not seem to be a color profile in the PNG image ("identify -verbose image.png | grep -i profile").

Thanks,

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

Re: convert PNG to PDF: color issues

Post by fmw42 »

can you post links to your png and pdf images so others can test them. Also what version of IM are you using? There has been some recent problems with -colorspace of late, mostly corrected now in the latest version.
areslagae
Posts: 5
Joined: 2012-02-08T02:30:49-07:00
Authentication code: 8675308

Re: convert PNG to PDF: color issues

Post by areslagae »

Hi all,

I think I have solved the issue.

The PNG file in question had a 1-bit alpha channel.

After removing that channel (convert -type TrueColor) the PNG to PDF conversion worked as expected.

Thanks,
Post Reply