CMYK Issue?

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
ScottGaines
Posts: 7
Joined: 2009-11-09T14:59:22-07:00
Authentication code: 8675309

CMYK Issue?

Post by ScottGaines »

I've been searching around for a bit trying everything i can think of and not really getting anywhere with my issue. I have search the forum a bit and couldn't find answer as well. My issue is converting a CMYK image and have the out put image stay a CMYK image. I know it might sound simple but for some reason it just will not work for me. Imagemagick keeps forcing RGB on the image

Some of the commands I've tried

Code: Select all

convert someimage.psd someimage2.eps
convert someimage.psd someimage2.pdf
convert someimage.psd someimage2.psd
convert someimage.psd someimage2.ai

convert someimage.eps someimage2.eps
convert someimage.eps someimage2.psd
convert someimage.eps someimage2.pdf
convert someimage.eps someimage2.ai

convert someimage.ai someimage2.eps
convert someimage.ai someimage2.psd
convert someimage.ai someimage2.pdf
convert someimage.ai someimage2.ai

convert -colorspace CMYK someimage.psd someimage2.eps
convert -colorspace CMYK someimage.psd someimage2.pdf
convert -colorspace CMYK someimage.psd someimage2.psd
convert -colorspace CMYK someimage.psd someimage2.ai

convert -colorspace CMYK someimage.eps someimage2.eps
convert -colorspace CMYK someimage.eps someimage2.psd
convert -colorspace CMYK someimage.eps someimage2.pdf
convert -colorspace CMYK someimage.eps someimage2.ai

convert -colorspace CMYK someimage.ai someimage2.eps
convert -colorspace CMYK someimage.ai someimage2.psd
convert -colorspace CMYK someimage.ai someimage2.pdf
convert -colorspace CMYK someimage.ai someimage2.ai

convert someimage.psd -colorspace CMYK someimage2.eps
convert someimage.psd -colorspace CMYK someimage2.pdf
convert someimage.psd -colorspace CMYK someimage2.psd
convert someimage.psd -colorspace CMYK someimage2.ai

convert someimage.eps -colorspace CMYK someimage2.eps
convert someimage.eps -colorspace CMYK someimage2.psd
convert someimage.eps -colorspace CMYK someimage2.pdf
convert someimage.eps -colorspace CMYK someimage2.ai

convert someimage.ai -colorspace CMYK someimage2.eps
convert someimage.ai -colorspace CMYK someimage2.psd
convert someimage.ai -colorspace CMYK someimage2.pdf
convert someimage.ai -colorspace CMYK someimage2.ai

convert someimage.psd -profile USWebCoatedSWOP.icc someimage2.eps
convert someimage.psd -profile USWebCoatedSWOP.icc someimage2.pdf
convert someimage.psd -profile USWebCoatedSWOP.icc someimage2.psd
convert someimage.psd -profile USWebCoatedSWOP.icc someimage2.ai

convert someimage.eps -profile USWebCoatedSWOP.icc someimage2.eps
convert someimage.eps -profile USWebCoatedSWOP.icc someimage2.psd
convert someimage.eps -profile USWebCoatedSWOP.icc someimage2.pdf
convert someimage.eps -profile USWebCoatedSWOP.icc someimage2.ai

convert someimage.ai -profile USWebCoatedSWOP.icc someimage2.eps
convert someimage.ai -profile USWebCoatedSWOP.icc someimage2.psd
convert someimage.ai -profile USWebCoatedSWOP.icc someimage2.pdf
convert someimage.ai -profile USWebCoatedSWOP.icc someimage2.ai
I've also tried to strip the profile info when converting I've done almost everything I can think of.

verbose of input image

Code: Select all

C:\Program Files\ImageMagick-6.7.4-2>identify -verbose test/CMYKtest.psd[0]
Image: test/CMYKtest.psd
  Base filename: CMYKtest.psd
  Format: PSD (Adobe Photoshop bitmap)
  Class: DirectClass
  Geometry: 2788x1324+0+0
  Resolution: 300x300
  Print size: 9.29333x4.41333
  Units: PixelsPerInch
  Type: ColorSeparationMatte
  Endianess: Undefined
  Colorspace: CMYK
  Depth: 8-bit
  Channel depth:
    cyan: 8-bit
    magenta: 8-bit
    yellow: 8-bit
    black: 8-bit
    alpha: 8-bit
  Channel statistics:
    Cyan:
      min: 0 (0)
      max: 237 (0.929412)
      mean: 59.9467 (0.235085)
      standard deviation: 57.9938 (0.227427)
      kurtosis: -0.263981
      skewness: 0.866552
    Magenta:
      min: 0 (0)
      max: 255 (1)
      mean: 142.772 (0.559892)
      standard deviation: 96.0997 (0.376862)
      kurtosis: -1.4509
      skewness: -0.31729
    Yellow:
      min: 0 (0)
      max: 255 (1)
      mean: 151.74 (0.595058)
      standard deviation: 98.3249 (0.385588)
      kurtosis: -1.35911
      skewness: -0.421298
    Black:
      min: 0 (0)
      max: 230 (0.901961)
      mean: 47.6346 (0.186802)
      standard deviation: 67.5497 (0.264901)
      kurtosis: 0.0398984
      skewness: 1.2248
    Alpha:
      min: 0 (0)
      max: 255 (1)
      mean: 205.939 (0.807606)
      standard deviation: 100.331 (0.393453)
      kurtosis: 0.440234
      skewness: 1.56072
  Image statistics:
    Overall:
      min: 0 (0)
      max: 255 (1)
      mean: 90.2308 (0.353846)
      standard deviation: 85.9016 (0.336869)
      kurtosis: -0.06833
      skewness: 0.868103
  Total ink density: 301%
  Alpha: cmyka(0,0,0,0,0)   #0000000000
  Rendering intent: Undefined
  Interlace: None
  Background color: cmyka(255,255,255,0,1)
  Border color: cmyka(223,223,223,0,1)
  Matte color: cmyka(189,189,189,0,1)
  Transparent color: cmyka(0,0,0,0,0)
  Compose: Over
  Page geometry: 2788x1324+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: RLE
  Orientation: TopLeft
  Properties:
    aux:Firmware: 2.0.8
    aux:FlashCompensation: 0/1
    aux:ImageNumber: 0
    aux:Lens: EF50mm f/2.5 Compact Macro
    aux:LensID: 10
    aux:LensInfo: 50/1 50/1 0/0 0/0
    aux:SerialNumber: 2921503883
    crs:AlreadyApplied: True
    crs:BlueHue: 0
    crs:BlueSaturation: 0
    crs:Brightness: +50
    crs:CameraProfile: Adobe Standard
    crs:CameraProfileDigest: 3DA8CE4A626CE36A1D0C55BF157793C9
    crs:ChromaticAberrationB: 0
    crs:ChromaticAberrationR: 0
    crs:Clarity: +40
    crs:ColorNoiseReduction: 25
    crs:ColorNoiseReductionDetail: 50
    crs:Contrast: +25
    crs:ConvertToGrayscale: False
    crs:CropAngle: -6.53245
    crs:CropBottom: 0.881889
    crs:CropConstrainToWarp: 0
    crs:CropHeight: 3214
    crs:CropLeft: 0.2534
    crs:CropRight: 0.697311
    crs:CropTop: 0.094079
    crs:CropUnit: 0
    crs:CropWidth: 2141
    crs:Defringe: 0
    crs:Exposure: +0.10
    crs:FillLight: 18
    crs:GrainAmount: 0
    crs:GreenHue: 0
    crs:GreenSaturation: 0
    crs:HasCrop: True
    crs:HasSettings: True
    crs:HighlightRecovery: 0
    crs:HueAdjustmentAqua: 0
    crs:HueAdjustmentBlue: 0
    crs:HueAdjustmentGreen: 0
    crs:HueAdjustmentMagenta: 0
    crs:HueAdjustmentOrange: 0
    crs:HueAdjustmentPurple: 0
    crs:HueAdjustmentRed: 0
    crs:HueAdjustmentYellow: 0
    crs:LensManualDistortionAmount: 0
    crs:LensProfileEnable: 0
    crs:LensProfileSetup: LensDefaults
    crs:LuminanceAdjustmentAqua: 0
    crs:LuminanceAdjustmentBlue: 0
    crs:LuminanceAdjustmentGreen: 0
    crs:LuminanceAdjustmentMagenta: 0
    crs:LuminanceAdjustmentOrange: 0
    crs:LuminanceAdjustmentPurple: 0
    crs:LuminanceAdjustmentRed: 0
    crs:LuminanceAdjustmentYellow: 0
    crs:LuminanceNoiseReductionContrast: 0
    crs:LuminanceNoiseReductionDetail: 50
    crs:LuminanceSmoothing: 21
    crs:ParametricDarks: 0
    crs:ParametricHighlights: 0
    crs:ParametricHighlightSplit: 75
    crs:ParametricLights: 0
    crs:ParametricMidtoneSplit: 50
    crs:ParametricShadows: 0
    crs:ParametricShadowSplit: 25
    crs:PerspectiveHorizontal: 0
    crs:PerspectiveRotate: 0.0
    crs:PerspectiveScale: 100
    crs:PerspectiveVertical: 0
    crs:PostCropVignetteAmount: 0
    crs:ProcessVersion: 5.7
    crs:RedHue: 0
    crs:RedSaturation: 0
    crs:Saturation: 0
    crs:SaturationAdjustmentAqua: 0
    crs:SaturationAdjustmentBlue: 0
    crs:SaturationAdjustmentGreen: 0
    crs:SaturationAdjustmentMagenta: 0
    crs:SaturationAdjustmentOrange: 0
    crs:SaturationAdjustmentPurple: 0
    crs:SaturationAdjustmentRed: 0
    crs:SaturationAdjustmentYellow: 0
    crs:Shadows: 16
    crs:ShadowTint: 0
    crs:SharpenDetail: 25
    crs:SharpenEdgeMasking: 0
    crs:SharpenRadius: +1.0
    crs:Sharpness: 25
    crs:SplitToningBalance: 0
    crs:SplitToningHighlightHue: 0
    crs:SplitToningHighlightSaturation: 0
    crs:SplitToningShadowHue: 0
    crs:SplitToningShadowSaturation: 0
    crs:Temperature: 3200
    crs:Tint: 0
    crs:ToneCurveName: Medium Contrast
    crs:Version: 6.4
    crs:Vibrance: 0
    crs:VignetteAmount: 0
    crs:WhiteBalance: Auto
    date:create: 2011-12-28T12:27:05-07:00
    date:modify: 2011-12-27T11:10:44-07:00
    dc:format: application/vnd.adobe.photoshop
    exif:ApertureValue: 5655638/1000000
    exif:ColorSpace: 65535
    exif:CustomRendered: 0
    exif:DateTimeDigitized: 2011-12-09T10:45:06-07:00
    exif:DateTimeOriginal: 2011-12-09T10:45:06-07:00
    exif:ExifVersion: 0230
    exif:ExposureBiasValue: 0/1
    exif:ExposureMode: 1
    exif:ExposureProgram: 1
    exif:ExposureTime: 1/40
    exif:Fired: False
    exif:FNumber: 71/10
    exif:FocalLength: 50/1
    exif:FocalPlaneResolutionUnit: 2
    exif:FocalPlaneXResolution: 5616000/1459
    exif:FocalPlaneYResolution: 3744000/958
    exif:Function: False
    exif:MaxApertureValue: 2625/1000
    exif:MeteringMode: 5
    exif:Mode: 2
    exif:NativeDigest: 36864,40960,40961,37121,37122,40962,40963,37510,40964,368
67,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382
,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,4
1728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,419
95,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,2
8,30;5D303C02AAF336F1F48128663FD37F8E
    exif:PixelXDimension: 2788
    exif:PixelYDimension: 1324
    exif:RedEyeMode: False
    exif:Return: 0
    exif:SceneCaptureType: 0
    exif:ShutterSpeedValue: 5321928/1000000
    exif:WhiteBalance: 0
    photoshop:ColorMode: 4
    photoshop:DateCreated: 2011-12-09
    photoshop:ICCProfile: U.S. Web Coated (SWOP) v2
    photoshop:LegacyIPTCDigest: 7257EE8AF99DA0A053963C2FD6C4CE24
    signature: 0d74d482759a5edaa0588a552fb407153d88337693a2a4cdd21f3f656798b3e6
    stRef:documentID: xmp.did:B7C1C7DF122068118A6D99661E9CBC6B
    stRef:instanceID: xmp.iid:B7C1C7DF122068118A6D99661E9CBC6B
    stRef:originalDocumentID: xmp.did:B7C1C7DF122068118A6D99661E9CBC6B
    tiff:ImageLength: 3214
    tiff:ImageWidth: 2141
    tiff:Make: Canon
    tiff:Model: Canon EOS 5D Mark II
    tiff:NativeDigest: 256,257,258,259,262,274,277,284,530,531,282,283,296,301,3
18,319,529,532,306,270,271,272,305,315,33432;CDD5F21A2D215508456533C5709563BC
    tiff:PhotometricInterpretation: 2
    tiff:SamplesPerPixel: 3
    tiff:XResolution: 300
    tiff:YResolution: 300
    xmp:CreateDate: 2011-12-09T10:45:06.88
    xmp:CreatorTool: Adobe Photoshop CS5 Macintosh
    xmp:MetadataDate: 2011-12-27T11:10:42-07:00
    xmp:ModifyDate: 2011-12-27T11:10:42-07:00
    xmp:Rating: 2
    xmpMM:DocumentID: xmp.did:B7C1C7DF122068118A6D99661E9CBC6B
    xmpMM:InstanceID: xmp.iid:120958D8B530E1119343C2812F7E6705
    xmpMM:OriginalDocumentID: xmp.did:B7C1C7DF122068118A6D99661E9CBC6B
  Profiles:
    Profile-8bim: 594488 bytes
    Profile-exif: 910 bytes
    Profile-icc: 557168 bytes
      Description: U.S. Web Coated (SWOP) v2
      Manufacturer: U.S. Web Coated (SWOP) v2
      Model: U.S. Web Coated (SWOP) v2
      Copyright: Copyright 2000 Adobe Systems, Inc.
    Profile-iptc: 73 bytes
      City[1,90]: 0x00000000: 254700                                        -%
      City[1,90]: 0x00000000: 254700                                        -%
      City[1,90]: 0x00000000: 254700                                        -%
      unknown[2,0]:
      Created Date[2,55]: 20111209
      Created Time[2,60]: 104506+0000
      unknown[2,62]: 20111209
    Profile-xmp: 27428 bytes
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 22.67MB
  Number pixels: 3.691MB
  Pixels per second: 13.88MB
  User time: 0.375u
  Elapsed time: 0:01.266
  Version: ImageMagick 6.7.4-1 2011-12-18 Q16 http://www.imagemagick.org
verbose of output image

Code: Select all

C:\Program Files\ImageMagick-6.7.4-2>identify -verbose test/test.eps
Image: test/test.eps
  Format: PS (PostScript)
  Class: DirectClass
  Geometry: 669x318+0+0
  Resolution: 72x72
  Print size: 9.29167x4.41667
  Units: Undefined
  Type: TrueColorMatte
  Endianess: Undefined
  Colorspace: RGB
  Depth: 16/8-bit
  Channel depth:
    red: 8-bit
    green: 8-bit
    blue: 8-bit
    alpha: 1-bit
  Channel statistics:
    Red:
      min: 0 (0)
      max: 65535 (1)
      mean: 27910.7 (0.42589)
      standard deviation: 22356.7 (0.341142)
      kurtosis: -1.03597
      skewness: 0.614735
    Green:
      min: 0 (0)
      max: 65535 (1)
      mean: 49202.9 (0.750788)
      standard deviation: 18851.2 (0.28765)
      kurtosis: -0.542833
      skewness: -0.911937
    Blue:
      min: 0 (0)
      max: 65535 (1)
      mean: 51514.5 (0.786061)
      standard deviation: 18053.7 (0.275481)
      kurtosis: -0.181209
      skewness: -1.04458
    Alpha:
      min: 65535 (1)
      max: 65535 (1)
      mean: 65535 (1)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
  Image statistics:
    Overall:
      min: 0 (0)
      max: 65535 (1)
      mean: 32157 (0.490685)
      standard deviation: 17183.7 (0.262207)
      kurtosis: 5.0058
      skewness: 0.208104
  Rendering intent: Undefined
  Interlace: None
  Background color: white
  Border color: rgba(223,223,223,1)
  Matte color: grey74
  Transparent color: none
  Compose: Over
  Page geometry: 669x318+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2011-12-28T13:14:49-07:00
    date:modify: 2011-12-28T13:14:50-07:00
    ps:HiResBoundingBox: 669.12x318+0+0
    ps:Level: Adobe-3.0 EPSF-3.0

    signature: 4b7d135574647ea75f53c76e5dd9a9e02c66a9580d42c1a61607aa196ab509e9
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 445KB
  Number pixels: 213KB
  Pixels per second: 13.3MB
  User time: 0.016u
  Elapsed time: 0:01.015
  Version: ImageMagick 6.7.4-1 2011-12-18 Q16 http://www.imagemagick.org
If anyone has any ideas please let me know
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK Issue?

Post by fmw42 »

Your psd file seems to have an imbedded Tiff if I read that correctly. The tiff may be rgb and confusing IM. I am not an expert on this. However, you should be able to add -colorspace CMYK to your command and get CMYK for the resulting output.

convert yourimage.psd[0] -colorspace CMYK yourimage.pdf

or use profiles.

Perhaps some one else with more knowledge about psd can comment further.
ScottGaines
Posts: 7
Joined: 2009-11-09T14:59:22-07:00
Authentication code: 8675309

Re: CMYK Issue?

Post by ScottGaines »

Thank you fmw42 for your quick response. I looked into it and the image I was using did contain a picture and I do believe that is what was forcing the RGB. However I made a PSD and an AI file both in the color space of CMYK and used only cyan magenta yellow and black and ended up with the same results for eps files SO I believe the issue truly is converting to eps files.

command used : convert test/test.psd -colorspace CMYK test/test.eps and convert test/test.ai -colorspace CMYK test/test.eps
I used adobe cs4 to make the files strange thing was i verbose the ai file and it said it was in RGB though i know i saved it as CMYK

I using ImageMagick-6.6.1-Q16 but upgraded to ImageMagick-6.7.4-2 to see if that would work but i get the same results in both

I you or anyone has any ideas please let me know Now that I know the actual problem I'm going to go back and do some more searching around to see if i can find a solution.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK Issue?

Post by fmw42 »

If you can post a link to an example file that is causing trouble. You have to host it on some free image hosting site such as dropbox or any other and then put the link to it in you post here.
ScottGaines
Posts: 7
Joined: 2009-11-09T14:59:22-07:00
Authentication code: 8675309

Re: CMYK Issue?

Post by ScottGaines »

No Problem I'll add my testing notes to myself as well.

This file includes all of the files I was using as well as the files I converted
http://www.indefinitedesigns.com/test_files.zip

If you don't feel safe with a zip file that is understandable so the three files I was testing are below
http://www.indefinitedesigns.com/test.ai
http://www.indefinitedesigns.com/test.psd
http://www.indefinitedesigns.com/test.eps

Code: Select all

Test 1

Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace CMYK test/test1.jpg		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace RGB test/test1-1.jpg		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -profile sRGB.icm test/test1-2.jpg	Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace CMYK test/test1.tif		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace RGB test/test1-1.tif		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -profile sRGB.icm test/test1-2.tif	Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace CMYK test/test1.png		Fails as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace RGB test/test1-1.png		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -profile sRGB.icm test/test1-2.png	Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace CMYK test/test1.gif		Fails as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace RGB test/test1-1.gif		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -profile sRGB.icm test/test1-2.gif	Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace CMYK test/test1.bmp		Fails as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace RGB test/test1-1.bmp		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -profile sRGB.icm test/test1-2.bmp	Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace CMYK test/test1.eps		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace RGB test/test1-1.eps		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -profile sRGB.icm test/test1-2.eps	Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace CMYK test/test1.pdf		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -colorspace RGB test/test1-1.pdf		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.psd[0] -profile sRGB.icm test/test1-2.pdf	Works as expected

PSD to JPEG, TIFF, PDF - works in both CMYK and RGB colorspace.
PSD to PNG, GIF, BMP, EPS - works Only RGB colorspace.

EPS is a cmyk format supported image but unable to convert a cmyk image to a cmyk eps?

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

Test 2

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace CMYK test/test2.jpg		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace RGB test/test2-1.jpg		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -profile sRGB.icm test/test2-2.jpg		Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace CMYK test/test2.png		Works unexpected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace RGB test/test2-1.png		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -profile sRGB.icm test/test2-2.png		Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace CMYK test/test2.gif		Works unexpected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace RGB test/test2-1.gif		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -profile sRGB.icm test/test2-2.gif		Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace CMYK test/test2.bmp		Works unexpected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace RGB test/test2-1.bmp		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -profile sRGB.icm test/test2-2.bmp		Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace CMYK test/test2.tif		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace RGB test/test2-1.tif		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -profile sRGB.icm test/test2-2.tif		Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace CMYK test/test2.eps		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace RGB test/test2-1.eps		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -profile sRGB.icm test/test2-2.eps		Works as expected

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace CMYK test/test2.pdf		Fails
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -colorspace RGB test/test2-1.pdf		Works as expected
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.ai -profile sRGB.icm test/test2-2.pdf		Works as expected

Odd results .... Verbosed the test.ai and imagemagick claims its in RGB though Frustrator cs4 says its in CMYK and I created it in CMYK
The unexpected success on the RGB only files was strange but concidering that imagemagick Thinks the test.ai has something to do with it. verbosed those files and the are in RGB as expected.

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

Test 3

C:\Program Files\ImageMagick-6.7.4-2>convert test/test.eps test/test3.eps
C:\Program Files\ImageMagick-6.7.4-2>convert test/test.eps -colorspace CMYK test/test3.eps

Starting to think Imagemagick Cannot Handle EPS files correctly. I made test.eps in Frustrator cs4 and verbosed it it shows its in CMYK coverted it and verbosed the convert and it shows its in RGB?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK Issue?

Post by fmw42 »

1) With vector formats such as pdf, eps, ai, etc. you need to tell the image what colorspace to use as you read it in. You will note when you open your ai file, PS asks you which colorspace you want.

In IM to read it as rgb, use

convert -colorspace rgb image.eps result

or as cmyk

convert -colorspae cmyk image.eps result

Many IM functions only work in RGB mode. IM may always just say RGB, but it is not determined until you tell it what to use when your read it in.

For example:

convert -colorspace CMYK test.ai test1_cmyk.ai
identify -verbose test1_cmyk.ai
Image: test1_cmyk.ai
Format: PDF (Portable Document Format)
Class: DirectClass
Geometry: 612x792+0+0
Resolution: 72x72
Print size: 8.5x11
Units: Undefined
Type: ColorSeparation
Base type: ColorSeparation
Endianess: Undefined
Colorspace: CMYK

And PS also opens it without asking for the colorspace and knows it is CMYK.

For eps, it looks like no matter what you do, you get a result that still needs to be told what colorspace to use to read it. I don't know if this is an IM bug or not.

convert -colorspace CMYK test.eps test_cmyk.eps
identify test_cmyk.eps
Image: test_cmyk.eps
Format: PS (PostScript)
Class: DirectClass
Geometry: 612x792+0+0
Resolution: 72x72
Print size: 8.5x11
Units: Undefined
Type: PaletteMatte
Endianess: Undefined
Colorspace: RGB

But I think it is still just not determined what is the colorspace, since when I open it in PS, it still asks me to tell it what colorspace to use.



2) PNG does not support CMYK nor does GIF, I believe. I don't know about BMP. JPG and TIFF support CMYK. EPS is a vector format and you have to tell it what colorspace you want to use when reading it in. As above.



3) identify -verbose test.psd[0]

Image: test.psd
Base filename: test.psd
Format: PSD (Adobe Photoshop bitmap)
Class: DirectClass
Geometry: 200x200+0+0
Resolution: 72x72
Print size: 2.77778x2.77778
Units: PixelsPerInch
Type: ColorSeparationMatte
Endianess: Undefined
Colorspace: CMYK
...
Profile-icc: 557168 bytes
Description: U.S. Web Coated (SWOP) v2
Manufacturer: U.S. Web Coated (SWOP) v2
Model: U.S. Web Coated (SWOP) v2
Copyright: Copyright 2000 Adobe Systems, Inc.


So it looks like it is CMYK.


3)

convert test.psd[0] -colorspace rgb test_psd_rgb.tif
convert test.psd[0] -colorspace rgb test_psd_rgb.jpg

both works but the colors are slightly off because your image has a cmyk profile.


4) convert test.psd[0] -profile Profiles/USWebCoatedSWOP.icc -profile Profiles/sRGB.icc test_psd_rgb_profiles.tif

looks pretty close to your CMYK input.


5) This works fine for me

convert test.psd[0] test1.psd
identify -verbose test1.psd
Image: test1.psd
Format: PSD (Adobe Photoshop bitmap)
Class: DirectClass
Geometry: 200x200+0+0
Resolution: 72x72
Print size: 2.77778x2.77778
Units: PixelsPerInch
Type: ColorSeparationMatte
Endianess: Undefined
Colorspace: CMYK
ScottGaines
Posts: 7
Joined: 2009-11-09T14:59:22-07:00
Authentication code: 8675309

Re: CMYK Issue?

Post by ScottGaines »

I added in the read in CMYK and that solved the issue with the AI files I was having.
converting from EPS to any file works fine with both CMYK and RGB converts. Converting to an EPS always goes into RGB even if the it is specified for CMYK and the source file is in CMYK.

So most my issues have been resolved except for the convert to a CMYK EPS. I'm not even sure if imagemagick can handle doing it. Since I can't find any documentation to convert to an EPS only from one. I have seen things for ghostscript and I have ghostscript installed as well but not too sure how to use it.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK Issue?

Post by fmw42 »

Converting to an EPS always goes into RGB even if the it is specified for CMYK and the source file is in CMYK.
Yes, that still puzzles me, but I don't know enough about eps images to say.

You might want to post that to the Bugs forum and see what the IM developers say.
ScottGaines
Posts: 7
Joined: 2009-11-09T14:59:22-07:00
Authentication code: 8675309

Re: CMYK Issue?

Post by ScottGaines »

Thank You for your help I have gotten a solution to the issue with the RGB eps files. From what I found since imagmagick is a raster based convertor it can convert to vector formats however it will do so in a raster format which can affect the quality of the image. It uses Ghostscript to read/write the file with that in mind the command i came across is

convert test.psd[0] -colorspace CMYK eps3:test.eps

This command will convert an image from CMYK or RGB to a CMYK EPS file. However if you started with a vector image you will end up with a raster based image It also looses the alpha channel So all quality and size should be specified in the convert command because the image will now distort if stretched.

I'll mess with the transparency issue a bit and post if i find an answer to that issue
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: CMYK Issue?

Post by fmw42 »

this works for me


convert -colorspace cmyk test.eps EPS3:test_cmyk.eps
convert -colorspace cmyk test.psd[0] EPS3:test_cmyk2.eps

So I think it is the EPS3: format that does the trick.


With regard to transparency, I am not an expert on this issue, but it may be the delegates.xml file device. For some formats you can have one device that allows multiframe transfer but no transparency or another device that does not allow multiframes but does allow transparency. I don't know if that applies to pdf to eps or not?

Can you provide an example pdf or whatever you need with transparency, so I can see what happens on my system?
indiego
Posts: 75
Joined: 2010-10-16T06:35:10-07:00
Authentication code: 8675308

Re: CMYK Issue?

Post by indiego »

ScottGaines wrote:...

I'll mess with the transparency issue a bit and post if i find an answer to that issue
Postscript does not support transparency and that's the reason why the graphics are flattened. Use PDF (the successor of PS) if you need transparency.
ScottGaines
Posts: 7
Joined: 2009-11-09T14:59:22-07:00
Authentication code: 8675309

Re: CMYK Issue?

Post by ScottGaines »

That dose make sense I know I had some trouble in the past with going from EPS to PNG which I resolved. Going to a PDF is fine and works so If I need transparency I'll use PDF. Thank you indiego for that info.
Post Reply