generating draw-rectangle image blank image in cmyk

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
jedierikb
Posts: 20
Joined: 2012-12-13T13:59:27-07:00
Authentication code: 6789

generating draw-rectangle image blank image in cmyk

Post by jedierikb »

Code: Select all

convert -set units PixelsPerInch -density 300 -size 1200x1800 xc:#fff -fill xc:#f00 -draw 'rectangle 0 0 100 100' -black-point-compensation -intent Relative -profile USWebCoatedSWOP.icc test.tiff
The following code is producing an image which, when opened in photoshop, presents me with a warning "The embedded ICC profile cannot be used because the ICC profile is invalid. Ignoring the profile." How to properly embed the profile in this case?

And in this case,

Code: Select all

convert -set units PixelsPerInch -density 300 -size 1200x1800 xc:#fff -black-point-compensation -intent Relative -profile USWebCoatedSWOP.icc blank.tiff
In this case, I am successfully generating a blank image, but it is not cmyk... (rather, according to photoshop, 'bitmap').
jedierikb
Posts: 20
Joined: 2012-12-13T13:59:27-07:00
Authentication code: 6789

Re: generating draw-rectangle image blank image in cmyk

Post by jedierikb »

ImageMagick 6.9.1-8 Q16 x86_64
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: generating draw-rectangle image blank image in cmyk

Post by fmw42 »

What platform? If unix, then you need to enclose the #fff in quotes. The following works for me on my Mac OSX snowleopard using IM 6.9.1.8 Q16. When I open it in PS (CS -- very old), it does not complain about the profile.

It is possible that PS is more sensitive in current versions. You are creating a bilevel (b/w) grayscale image. I am not sure if applying USWebCoatedSWOP.icc to a bilevel image is the issue?

Create the input image first, then use -units rather than -set units afterwards

Code: Select all

convert -size 1200x1800 xc:"#fff" -units PixelsPerInch -density 300 -black-point-compensation \
-intent Relative -profile /Users/fred/images/profiles/USWebCoatedSWOP.icc blank.tiff
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: generating draw-rectangle image blank image in cmyk

Post by snibgo »

Code: Select all

convert -set units PixelsPerInch -density 300 -size 1200x1800 xc:#fff -fill xc:#f00 -draw 'rectangle 0 0 100 100' -black-point-compensation -intent Relative -profile USWebCoatedSWOP.icc test.tiff
You are creating an image with RGB channels and assigning a CMYK profile. Software will try to read your RGB channels as if they were CMYK. I'm not surprised Photoshop doesn't like it.

A more conventional command would first assign an sRGB profile, then convert to USWebCoatedSWOP.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: generating draw-rectangle image blank image in cmyk

Post by fmw42 »

I would agree with user snibgo. I think he has pinpointed the problem and the solution.
Post Reply