Convert CMYK pdf to RGB jpeg ?

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
rhordern
Posts: 3
Joined: 2012-10-27T03:24:50-07:00
Authentication code: 67789

Convert CMYK pdf to RGB jpeg ?

Post by rhordern »

Hello,

I'm trying to convert a CMYK pdf to RGB jpeg but the following command :

Code: Select all

convert -profile CMYK.icc -profile RGB.icc test.pdf test.jpeg
gives the following warning :

Code: Select all

convert: associate profile with image, a source and destination color profile required for transform `icc' @ profile.c/ProfileImage/812.
As you can see I have specified two color profiles, any idea why I'm getting this error ?

The PDF doesn't seem to contain a color profile :

Code: Select all

# identify -verbose test.pdf
Image: /home/…/test.pdf
  Format: PDF (Portable Document Format)
  Class: DirectClass
  Geometry: 467x637+0+0
  Resolution: 72x72
  Print size: 6.48611x8.84722
  Units: Undefined
  Type: ColorSeparation
  Base type: ColorSeparation
  Endianess: Undefined
  Colorspace: CMYK
  Depth: 16/8-bit
  Channel depth:
    cyan: 8-bit
    magenta: 8-bit
    yellow: 8-bit
    black: 4-bit
  Channel statistics:
    cyan:
      min: 0 (0)
      max: 65535 (1)
      mean: 20812.3 (0.317575)
      standard deviation: 17659.6 (0.269468)
      kurtosis: -0.356738
      skewness: 0.547486
    magenta:
      min: 0 (0)
      max: 65535 (1)
      mean: 31535.4 (0.4812)
      standard deviation: 22311.4 (0.34045)
      kurtosis: -1.45924
      skewness: -0.388458
    yellow:
      min: 0 (0)
      max: 65535 (1)
      mean: 32927.3 (0.502439)
      standard deviation: 22486.4 (0.34312)
      kurtosis: -1.36961
      skewness: -0.500661
    black:
      min: 0 (0)
      max: 17476 (0.266667)
      mean: 7.02027 (0.000107122)
      standard deviation: 349.645 (0.00533525)
      kurtosis: 2481.88
      skewness: 49.8239
  Image statistics:
    Overall:
      min: 0 (0)
      max: 65535 (1)
      mean: 17056.4 (0.260264)
      standard deviation: 21783.7 (0.332399)
      kurtosis: -1.06082
      skewness: 0.761991
  Total ink density: 300%
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: cmyk(223,223,223,0)
  Matte color: grey74
  Transparent color: black
  Page geometry: 467x637+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2013-10-12T14:47:11+02:00
    date:modify: 2013-10-12T14:47:11+02:00
    pdf:HiResBoundingBox: 467.15x637.23+0+0
    pdf:SpotColor-0: All
    pdf:Version: PDF-1.3 3 0 obj <<
    signature: 98df6266a4144537bb7817b2f51a7600f9deec09f7471f9659aab0d17c3e1b4d
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 1.135mb
  Number pixels: 291kb
  Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org
I know this message is a warning and can in some cases be ignored, but I don't see why I'm getting it and could be a first step to understanding why I'm getting poor colors in the resulting jpg

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

Re: Convert CMYK pdf to RGB jpeg ?

Post by fmw42 »

easiest way is

convert -colorspace sRGB image.pdf image.jpg

With profiles, perhaps you need to read the input pdf image first before -profile?
rhordern
Posts: 3
Joined: 2012-10-27T03:24:50-07:00
Authentication code: 67789

Re: Convert CMYK pdf to RGB jpeg ?

Post by rhordern »

Hello,

Yes with colorspace it works but the colors are not good… I've tried with input image before and after the color profiles and I get the same. I'm now wandering if it could be the PDF document that contains multiple images and maybe some of them don't have a colorspace.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert CMYK pdf to RGB jpeg ?

Post by fmw42 »

did you try the full path the profile files?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert CMYK pdf to RGB jpeg ?

Post by snibgo »

I see your output profile is RGB.icc. This is unusual. sRGB.icc would be more common. You need both icc files in your current directory, of course.

Can you put your test.pdf file somewhere and put the URL here?
snibgo's IM pages: im.snibgo.com
Post Reply