PDF to JPG Washed Out / Faded Colors

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
aes

PDF to JPG Washed Out / Faded Colors

Post by aes »

I'm running the latest version: ImageMagick 6.5.2-4 however every time I convert to jpg the colors seem dull / faded. I have tried using -colorspace RGB but this over colors the image

Can anyone suggest anything

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

Re: PDF to JPG Washed Out / Faded Colors

Post by fmw42 »

what image type are you converting from? can you give use your exact command and provide the image?
aes

Re: PDF to JPG Washed Out / Faded Colors

Post by aes »

PDF Input:
http://www.megaupload.com/?d=E4KAHZ7S

JPG Output:
http://img140.imageshack.us/img140/5482/page0z.jpg

Code: Select all

 convert -density 150 -limit memory 1mb -limit map 2mb ".$file." ".$output;
I have added -colorspace rgb which does improve the image but seems to overdo the colors, so something in between would be perfect

http://img294.imageshack.us/img294/8291/page0.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PDF to JPG Washed Out / Faded Colors

Post by anthony »

You need to get your profiles right!
http://www.imagemagick.org/Usage/formats/#profiles
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
aes

Re: PDF to JPG Washed Out / Faded Colors

Post by aes »

what would you recommend?, I have tried a couple with no luck
aes

Re: PDF to JPG Washed Out / Faded Colors

Post by aes »

anyone else have any ideas could really do with some help on this one :?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to JPG Washed Out / Faded Colors

Post by fmw42 »

I cannot seem to test your pdf as my Ghostscript apparently is not compatible and I do not know how to correct that.

convert pricelist.pdf pricelist1.jpg
Unknown device: bmpsep8
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
defaultdevice
convert: Postscript delegate failed `pricelist.pdf': No such file or directory @ pdf.c/ReadPDFImage/611.
convert: missing an image filename `pricelist1.jpg' @ convert.c/ConvertImageCommand/2775.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to JPG Washed Out / Faded Colors

Post by fmw42 »

correction! this works just fine. perhaps your image is cmyk pdf

convert -colorspace rgb pricelist.pdf info:
pricelist.pdf[0] PDF 1191x595 1191x595+0+0 16-bit DirectClass 4.055mb
pricelist.pdf[1] PDF 1191x595 1191x595+0+0 16-bit DirectClass 4.055mb


So two pages.

This then works to produce reasonable looking images in IM 6.5.2-4 Q16 Mac OSX Tiger:

convert -colorspace rgb pricelist.pdf pricelist.jpg

I get pricelist-0.jpg and pricelist-1.jpg and both pages look fine.

You can improve the quality if you want with -quality and/or supersampling.

convert -colorspace rgb -density 400 pricelist.pdf -resize 25% -quality 100 pricelist.jpg
aes

Re: PDF to JPG Washed Out / Faded Colors

Post by aes »

very strange -colorspace rgb dosent seem to output correctly for me

here is the pdf saved as a jpg via photoshop which is what I'm aiming for:
http://img40.imageshack.us/my.php?image=pricelist1.jpg

and this is the output via ImageMagick using the command above:
http://img188.imageshack.us/my.php?image=page0.jpg
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to JPG Washed Out / Faded Colors

Post by fmw42 »

Your output using -colorspace rgb is the same as mine. But....

You will need to add the appropriate profiles to get your colors better. I am no expert on that. Did you read Anthony's page on profiles? Search the archives. I have seen many examples of this.

But you can also improve antialiasing by supersampling and change the quality as I mentioned above.

Here is what I get when I do

convert -colorspace rgb -density 400 pricelist.pdf[0] -resize 25% -quality 100 pricelist_new0.jpg

http://www.fmwconcepts.com/misc_tests/p ... t_new0.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: PDF to JPG Washed Out / Faded Colors

Post by anthony »

More than likely the washed out colors is because it is using a sRGB color space.
This is only available as a ICC profile, and thus needs you to use a profile color space conversion if you want to convert that to normal RGB colorspace, or visa-versa.

I am no expert in profile colorspaces, I know know what I have noted in IM Examples on Color Profiles.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
aes

Re: PDF to JPG Washed Out / Faded Colors

Post by aes »

fmw42 your output seems to be the same as my output.
yours :http://www.fmwconcepts.com/misc_tests/p ... t_new0.jpg
mine: http://img188.imageshack.us/img188/8291/page0.jpg

I have tried using a number of profiles:

AdobeRGB1998.icc
CMYK.icc
ColorArt85290.icc
ColorMatchRGB.icc
RGB.icc
sRGB.icc

None of them seem to produce the same results when opening a pdf in photoshop and saving as a jpg, does anyone know what photoshop is using when it makes the conversion?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF to JPG Washed Out / Faded Colors

Post by fmw42 »

No, my output is much sharper. Look carefully at the text at full resolution display. But as Anthony says, you need to use profiles to adjust the color. Search the archives. Perhaps the opposite of this reference viewtopic.php?f=1&t=13779 converting from cmyk to sRGB
aes

Re: PDF to JPG Washed Out / Faded Colors

Post by aes »

unless I'm going blind I cant notice any difference between mine and yours lol :?

its more about the color than the sharpness, how hard would it be to modify the rgb profile to make the image appear closer to the original after conversion? I've hunted everywhere for a solution, I cant be the only person having this problem, what I can say is that the version i was running previously 6.2.8.0 converted perfectly, looking exactly the same as the original however none of the newer functions worked hence why I upgraded, so I've gained the functions but lost the color lol
Post Reply