Page 1 of 1

convert CMYK EPS to RGBA PNG with clip (with profile)

Posted: 2009-05-11T08:49:32-07:00
by kriks
Hi all,


I have a CMYK EPS witha clip path inside, and I want to generate a png width the path clipped, so basically the picture with a transparent background, and I need to use icc profiles to make the conversion.

here is a sample of what I tried:

Code: Select all

#leads to a full transparent image:
convert 841267.eps -alpha On -background transparent -clip-path #1 -profile ../media/icc/ISOcoated.icc -profile ../media/icc/AdobeRGB1998.icc -depth 8 -resize 500x500 841267_clip+adobergb.png

# leads to a black background image:
convert 841267.eps -alpha On -clip -profile ../media/icc/ISOcoated.icc -profile ../media/icc/AdobeRGB1998.icc -depth 8 -resize 500x500 841267_clip+adobergb.png
I'm getting crazy :p turning and trying options in every way.

Could you help me ?

Re: convert CMYK EPS to RGBA PNG with clip (with profile)

Posted: 2009-05-11T10:01:35-07:00
by fmw42
try adding
-channel rgba before -alpha on

or
-channel cmyka before -alpha on

Re: convert CMYK EPS to RGBA PNG with clip (with profile)

Posted: 2009-05-12T01:24:38-07:00
by kriks
thank you, but it doesn't change anything...

FYI :
- ImageMagick 6.5.1-0 2009-05-11 Q16
- GPL Ghostscript 8.64 (2009-02-03)

Re: convert CMYK EPS to RGBA PNG with clip (with profile)

Posted: 2009-05-12T06:55:20-07:00
by kriks
After searching again for a while, it seems that ghostscript can't handle CMYKA images, so that may be the problem.

So I first generate a RGB PNG with the profiles, the colors are good but the background is white.

Now, I would like to extract the outer part of the clip path which is still inside the PNG,

I use :

Code: Select all

convert -verbose 841267_test.png -alpha On -fill none -clip 841267_test2.png
but the background remains white.

here is a identify -verbose on 841267_test.png :

Code: Select all

# identify -verbose 841267_test.png
Image: 841267_test.png
  Format: PNG (Portable Network Graphics)
  Class: DirectClass
  Geometry: 2158x1600+0+0
  Resolution: 300x300
  Print size: 7.19333x5.33333
  Units: Undefined
  Type: TrueColor
  Endianess: Undefined
  Colorspace: RGB
  Depth: 8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
  Channel statistics:
    red:
      min: 23 (0.0901961)
      max: 255 (1)
      mean: 238.012 (0.933381)
      standard deviation: 26.8681 (0.105365)
      kurtosis: 2.39327
      skewness: -1.65476
    green:
      min: 5 (0.0196078)
      max: 255 (1)
      mean: 204.667 (0.802616)
      standard deviation: 71.7491 (0.281369)
      kurtosis: -0.60666
      skewness: -0.99568
    blue:
      min: 0 (0)
      max: 255 (1)
      mean: 184.649 (0.724113)
      standard deviation: 95.2691 (0.373604)
      kurtosis: -1.17866
      skewness: -0.761039
  Image statistics:
    OverAll:
      min: 0 (0)
      max: 255 (1)
      mean: 156.832 (0.615027)
      standard deviation: 110.899 (0.434899)
      kurtosis: -1.5821
      skewness: -0.472438
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: rgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Page geometry: 2158x1600+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Properties:
    create-date: 2009-05-12T15:58:09+02:00
    modify-date: 2009-05-12T15:58:09+02:00
    ps:HiResBoundingBox: 518x384+0+0
    ps:Level: Adobe-3.0 EPSF-3.0
    signature: 6786af6f8651f993b0adf8455559a850edbdc22eb5838e422d511550ed70173b
  Clipping path:
<?xml version="1.0" encoding="iso-8859-1"?>
<svg width="2158" height="1600">
<g>
<path style="fill:#00000000;stroke:#00000000;stroke-width:0;stroke-antialiasing:false" d="
M 231.726,1048.98
C 210.736,1028.95 195.409,1017.27 176.418,984.731
C 157.427,952.19 146.932,919.149 146.932,919.149
C 146.932,919.149 135.937,911.139 130.939,906.633
C 125.942,902.128 125.442,897.622 124.442,891.614
...
M 1300.73,919.816
C 1300.73,919.816 1302.4,931.831 1295.73,939.174
C 1289.07,946.516 1271.74,952.524 1271.74,952.524
L 1277.07,956.195
C 1277.07,956.195 1298.07,948.853 1304.73,939.841
C 1311.39,930.83 1305.06,922.153 1300.73,919.816 Z
"/>
</g>
</svg>

  Profiles:
    Profile-8bim: 24012 bytes
    Profile-exif: 586 bytes
    Profile-icc: 560 bytes
      Adobe RGB (1998)
    Profile-iptc: 7 bytes
      unknown[2,0]:
    Profile-xml-code: 16774 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 1.401mb
  Number pixels: 3.293mb
  Version: ImageMagick 6.5.1-0 2009-05-11 Q16 http://www.imagemagick.org
this should work, no ?

Re: convert CMYK EPS to RGBA PNG with clip (with profile)

Posted: 2009-05-12T09:47:52-07:00
by fmw42
try adding -colorspace RGB before your input PDF

Re: convert CMYK EPS to RGBA PNG with clip (with profile)

Posted: 2009-05-13T00:16:02-07:00
by kriks
thanks but this does not work, as the png is already a RGB image.

If you meant "before the eps", it doesn't work either, as in this case, the profile is not used, and the colors are not good (seems that gostscript makes its own chemistery).

( see : viewtopic.php?f=1&t=13704&start=0&hilit ... ansparency )

I will report a bug for this clippath not working on the png, as it is a magick stuff.