Page 1 of 1

PNG -> PDF requires workaround

Posted: 2010-02-22T00:59:27-07:00
by mde
I'm trying to convert a PNG to PDF. The generated PDF's colors look bad (saturated?) -- really dark. I've messed with various quality/color/saturation settings, but to no effect. I don't really know what I'm doing (wrong), but this behavior looks wrong.

Code: Select all

$ convert foo.png foo.pdf
$ acroread foo.pdf  # ugly dark image
Workaround:

Code: Select all

$ convert -quality 100 foo.png foo.jpg
$ convert -quality 100 foo.jpg foo.pdf
$ acroread foo.pdf  # nice
Any tips appreciated!

BTW, I also found this old post that appears to be the same issue:
http://newsgroups.derkeiler.com/Archive ... 00256.html

Re: PNG -> PDF requires workaround

Posted: 2010-02-22T10:57:21-07:00
by fmw42
try

convert foo.png -density 300 foo.pdf

Re: PNG -> PDF requires workaround

Posted: 2010-02-22T11:26:28-07:00
by mde
Thanks. That does not affect the dark color though. I'm addressing my density misunderstanding in another thread (viewtopic.php?f=1&t=15622&p=55493), but I believe this color issue is unrelated to density.

So still a problem.

Re: PNG -> PDF requires workaround

Posted: 2010-02-22T11:29:28-07:00
by fmw42
post a link to your image so others can test or see if some other issue

Re: PNG -> PDF requires workaround

Posted: 2010-02-22T12:51:43-07:00
by mde
I've isolated the problem.

My whole conversion flow starts with a GIMP XCF.

1. pull JPG image into GIMP as a layer (layer is smaller than canvas)
2. "save as" foo.png
3. convert foo.png foo.pdf
4. look at dark ugly image

The problem only occurs if my GIMP canvas size does not match the original JPG's layer size. If the layer size matches, the convert goes well.

I can work around this problem by having GIMP do a "Layer to Image Size" for the JPG layer. So I suppose the advice I'll heed is to make sure image layers are always matched to image size.

I don't know if this is a GIMP or ImageMagick problem, but I'm not too worried about it at this point, as I have some workarounds/best practices to address it.