Page 1 of 1

PDF CMYK to RGB PNG

Posted: 2008-07-23T05:18:21-07:00
by kriks
Hello,

probably you already saw this, but I can't achieve this correctly. here is my commandline:

Code: Select all

#/usr/bin/convert -density 150 -profile ../media/icc/2008/Adobe/CMYKProfiles/USWebCoatedSWOP.icc 1701_REIMS.pdf[1] -trim -resize x2000 -profile ../media/icc/sRGB_v4.icc -depth 8 big_0001.uscoatedswop+srgb.png
the PNG color are really yellow, red turns to orange.

if I don't use any ICC, I get really "flashy" colors:

Code: Select all

/usr/bin/convert -density 150 -colorspace RGB 1701_REIMS.pdf[1] -trim -resize x2000 -depth 8 big_0001.no.png

I was given a ICC profile that's used for printing this PDF, it's supposed to soften colors, but I tried to use it without succes, maybe a wrong parameter order...

can you help me?

EDIT :
- imagemagick v6.3.8.3
- ghostscript v8.61

Re: PDF CMYK to RGB PNG

Posted: 2008-08-06T07:41:34-07:00
by geroldboehler
hi

i have the exact same problem here.
the problem is not only with png's also with jpg's. i also tried a lot of different profiles, no luck.

on the other hand, however, this only happens on linux. on mac os x (10.5.4) the converted files look perfect.
these are the versions i'm using:

linux:
im: 6.3.8
gs: 8.6.1

os x:
im: 6.3.6
gs: 8.5.4

i don't want to downgrade on my linux machine since i don't think that's the problem. does anyone have a clue? i was trying to figure this out for days...
here are two screenshots. the first one is how the pdf looks like and the second one is the (linux) generated png.
the images in the pdf are cmyk so i convert them using "EuropeISOCoatedFOGRA27.icc" and "sRGB Color Space Profile.icm".

Image
Image

any help or hint or whatever would be greatly appreciated!!!

thanks and regards

gerold

Re: PDF CMYK to RGB PNG

Posted: 2008-08-06T07:51:41-07:00
by magick
Color profiles only work if you have LCMS included in your ImageMagick build. Type
  • identify -list configure
Is lcms associates with the DELEGATES tag?

Re: PDF CMYK to RGB PNG

Posted: 2008-08-06T07:56:00-07:00
by geroldboehler
i just checked - they are enabled on mac and on linux. here's the output of identify -list configure

OS X:

Code: Select all

Path: /opt/local/lib/ImageMagick-6.3.6/config/configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            gcc
CFLAGS        -g -O2 -Wall -W -D_THREAD_SAFE
CONFIGURE     ./configure /opt/local/share/config.site /opt/local/etc/config.site
COPYRIGHT     Copyright (C) 1999-2007 ImageMagick Studio LLC
CPPFLAGS      -I/opt/local/include
CXX           g++
CXXFLAGS      -g -O2 -Wall -W -D_THREAD_SAFE
DEFS          -DHAVE_CONFIG_H
DELEGATES     bzlib dps fontconfig freetype jpeg lcms png tiff x11 xml zlib
DISTCHECK_CONFIG_FLAGS 'CPPFLAGS=-I/opt/local/include' 'LDFLAGS=-L/opt/local/lib' --disable-deprecate --with-fpx=no --with-fontpath= --with-gs-font-dir=/opt/local/share/ghostscript/fonts
EXEC-PREFIX   /opt/local
HOST          i386-apple-darwin8.10.1
LDFLAGS       -L/opt/local/lib -L/opt/local/lib -L/usr/X11R6/lib -L/opt/local/lib -lfreetype -lz -L/opt/local/lib
LIB_VERSION   0x636
LIB_VERSION_NUMBER 6,3,6,1
LIBS          -lMagick -llcms -ltiff -lfreetype -ljpeg -L/opt/local/lib -lfontconfig -lexpat -lXext -lSM -lICE -lX11 -lXt -lbz2 -lz -lm -lpthread
NAME          ImageMagick
PCFLAGS       
PREFIX        /opt/local
QuantumDepth  8
RELEASE_DATE  10/15/07
VERSION       6.3.6
WEBSITE       http://www.imagemagick.org

LINUX:

Code: Select all

Path: /usr/local/lib/ImageMagick-6.3.8/config/configure.xml

Name          Value
-------------------------------------------------------------------------------
CC            gcc
CFLAGS        -g -O2 -Wall -W -pthread
CONFIGURE     ./configure --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --with-gs-font-dir=/usr/share/fonts/type1/gsfonts
COPYRIGHT     Copyright (C) 1999-2008 ImageMagick Studio LLC
CPPFLAGS      -I/usr/local/include/ImageMagick
CXX           g++
CXXFLAGS      -g -O2 -Wall -W -pthread
DEFS          -DHAVE_CONFIG_H
DELEGATES     bzlib fontconfig freetype jpeg lcms png rsvg tiff x11 xml wmf zlib
DISTCHECK_CONFIG_FLAGS --disable-deprecate --with-djvu=no --with-umem=no --with-fontpath= --with-gs-font-dir=/usr/share/fonts/type1/gsfonts --with-lqr=no
EXEC-PREFIX   /usr/local
HOST          x86_64-unknown-linux-gnu
LDFLAGS       -L/usr/local/lib -lfreetype -lz
LIB_VERSION   0x638
LIB_VERSION_NUMBER 6,3,8,10
LIBS          -lMagickCore -llcms -ltiff -lfreetype -ljpeg -lfontconfig -lXext -lSM -lICE -lX11 -lbz2 -lz -lm -lpthread
NAME          ImageMagick
PCFLAGS       
PREFIX        /usr/local
QuantumDepth  8
RELEASE_DATE  02/21/08
VERSION       6.3.8
WEBSITE       http://www.imagemagick.org
thanks for your help!

basically profiles must work since when i try to use different profiles i get different results

Re: PDF CMYK to RGB PNG

Posted: 2008-08-08T05:51:10-07:00
by geroldboehler
please let me know if you need more information. i am really stuck here and need this to work :(

thanks for your help

gerold

Re: PDF CMYK to RGB PNG

Posted: 2008-08-08T06:01:11-07:00
by magick
Try this command:
  • convert -density 150 1701_REIMS.pdf[1] -strip -profile ../media/icc/2008/Adobe/CMYKProfiles/USWebCoatedSWOP.icc -profile ../media/icc/sRGB_v4.icc -trim -resize x2000 -depth 8 big_0001.uscoatedswop+srgb.png
This should work assuming your PDF is in the CMYK colorspace and your ps:cmyk delegate uses the 'pam' device. Locate delegates.xml and search for ps:cmyk.

Re: PDF CMYK to RGB PNG

Posted: 2008-08-11T05:36:58-07:00
by geroldboehler
i tried your command but i got the same results. on linux it looks blurry, on mac it looks perfect. i've attached my delegates.xml files. if you need anything else just let me know - thanks a lot!

gerold

delegates.zip

Re: PDF CMYK to RGB PNG

Posted: 2008-09-11T08:08:52-07:00
by geroldboehler
so this is what solved it for me:

edit /usr/local/lib/ImageMagick-6.3.3/config/delegates.xml and replace

-sDEVICE=pam

with

-sDEVICE=ppm

just in case someone is interested. thanks to everybody!