Page 1 of 1
Issue: convert PDF to JPG - Yellow color becomes Green
Posted: 2015-05-22T06:03:44-07:00
by quaker
Hello guys,
I'm stuck trying to convert PDF to JPG files.
The issue is, that the (light) yellow color on the PDF's first page becomes (light) green on exported JPGs.
When I export the PDF as JPG from Adobe Acrobat, (applying sRGB IEC61966-2.1 profile) it looks fine.
But I need to do that on the ImageMagick's side.
I blindly tried few Color Profiles (eg. sRGB_v4_ICC_preference.icc, AdobeRGB1998.icc), but nothing help.
Do you know what might be wrong?
Used cmd: convert -verbose -density 72 -profile AdobeRGB1998.icc -quality 100 file.pdf file.jpg
PDF file:
http://46.41.130.153/pdf/file.pdf
JPG exported from Adobe Acrobat:
http://46.41.130.153/pdf/adobe.jpg
JPG exported from ImageMagick:
http://46.41.130.153/pdf/convert.jpg
Re: Issue: convert PDF to JPG - Yellow color becomes Green
Posted: 2015-05-22T06:51:59-07:00
by snibgo
For starters, try the command in the correct order: read the input, process it, and write it:
Code: Select all
convert -verbose -density 72 file.pdf -profile AdobeRGB1998.icc -quality 100 file.jpg
But what are you trying to do with colour profiles? Converting the PDF to PNG, with no profiles:
... then viewing the PDF in Adobe Reader, and the PNG in MS Photo Viewer, they look the same to me.
IM v6.9.1-0 on Windows 8.1.
Re: Issue: convert PDF to JPG - Yellow color becomes Green
Posted: 2015-05-22T11:04:57-07:00
by quaker
Thank you for your reply, but it doesn't solve my issue.
When I do:
Code: Select all
convert -verbose -density 72 file.pdf -profile AdobeRGB1998.icc -quality 100 file.jpg
It generates JPGs, but with wrong color (same as before - the yellow becomes green).
The same result with PNG:
I tried:
ImageMagick 6.6.9-7 under Ubuntu 12
ImageMagick 6.7.7-10 under Debian 7
Re: Issue: convert PDF to JPG - Yellow color becomes Green
Posted: 2015-05-22T11:43:29-07:00
by snibgo
With this simple convert, not using profiles, I get yellow #ffff98. This is practically the same as your desired #ffff9a.
You are using very old versions of IM. If you don't get #ffff98, upgrading might fix the problem.
If you assign a profile, you will correctly get a different colour. Why do you want to asign the AdobeRGB1998 profile?
Re: Issue: convert PDF to JPG - Yellow color becomes Green
Posted: 2015-05-25T02:52:13-07:00
by quaker
Thank you for your assistance.
I've found a sollution.
ImageMagick was installed from the latest server's repository,
but even when I installed the latest ImageMagick (6.9.1-2) based on
http://www.imagemagick.org/script/install-source.php,
the result was the same.
The issue was an old GhostScript version:
# gs --version
I upgraded it to the latest one:
9.16
But then another issue appeared:
alpha / transparency was converted to black,
so I had the right color, but most of the area was black.
The sollution for it was to use:
-alpha remove
So the final cmd is:
Code: Select all
convert -verbose file.pdf -alpha remove jpg/file.jpg
I'm happy I've found a sollution,
thank you for your replies
and I hope it will help someone else.
Best regards!
Re: Issue: convert PDF to JPG - Yellow color becomes Green
Posted: 2015-05-25T02:57:55-07:00
by Bonzo
Thanks for getting back with the answer quaker.