[SOLVED] Magick++ ColorCMYK
[SOLVED] Magick++ ColorCMYK
Hi,
Would it be possible to get support for ColorCMYK in Magick++? I need to draw CMYK colors on CMYK image and can't find any CMYK color support in Magick++.
Regards
Would it be possible to get support for ColorCMYK in Magick++? I need to draw CMYK colors on CMYK image and can't find any CMYK color support in Magick++.
Regards
Last edited by rodlie on 2018-12-25T23:00:52-07:00, edited 1 time in total.
Re: Magick++ ColorCMYK
So, I'm able to get the correct(-ish) color by just adding cyan=>red etc, but for some reason the color/brush is transparent.
![Image](https://transfer.sh/6R5Pk/imagemagick-draw-on-cmyk.jpg)
Edit:
I'm running 6.9.10-16 Q16HDRI.
![Image](https://transfer.sh/6R5Pk/imagemagick-draw-on-cmyk.jpg)
Edit:
I'm running 6.9.10-16 Q16HDRI.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Magick++ ColorCMYK
What color brush? ImageMagick is command line driven for the most part.
Re: Magick++ ColorCMYK
I setup a brush then draw (DrawLine with strokeColor etc). Works fine on RGB, but not CMYK. (as seen on the image above). I guess ColorCMYK support in Magick++ would fix this? Or are there any workaround for this?
Code: Select all
image.strokeAntiAlias(...);
image.strokeLineCap(...);
image.strokeLineJoin(...);
image.strokeWidth(...);
image.strokeColor(...);
image.draw(...);
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Magick++ ColorCMYK
ImageMagick works best in RGB colors. I am not sure you can draw properly in CMYK. But I will defer to the IM developers to correct me.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Magick++ ColorCMYK
IM colour names are just shortcuts to particular pixel numbers, eg "red" is "#f00". But in CMY, "#f00" is really cyan.
So I suggest you use numbers, not names, when using CMYK.
So I suggest you use numbers, not names, when using CMYK.
snibgo's IM pages: im.snibgo.com
Re: Magick++ ColorCMYK
I always use color numbers in IM (so I don't need to reference colors.xml).
My problem is that it seems IM always will draw in RGB, but on an CMYK image the colors are "inverted" and transparent. I can fix the color but not the transparency.
My problem is that it seems IM always will draw in RGB, but on an CMYK image the colors are "inverted" and transparent. I can fix the color but not the transparency.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Magick++ ColorCMYK
That is what I mentioned earlier. I believe that -draw only works in RGB.
CMYK color specifications I believe are just converted to RGB values before being used.
Re: Magick++ ColorCMYK
Yeah, that's what I though. But using RGB colors still produces the transparency effect when drawing on CMYK, is there a way to workaround that issue? I would prefer not to convert the image to RGB before drawing and then converting back to CMYK, that will just kill performance (I could of course find ways around that as-well, but I just want to draw some pixels on an image just before print).
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Magick++ ColorCMYK
You should convert your CMYK image to RGB, then draw on it, then convert back to CMYK if you need it in that colorspace. Conversion with profiles does a better job than just -colorspace.
Re: Magick++ ColorCMYK
Yeah, I know, but as I said earlier I don't want to do that if possible. Why is drawing anything on CMYK (except for black) transparent? is there something I need to set, or know about? I'm also open to modifying the (IM) source just to get this (no transparency) working. Any pointers to the problem is welcome ![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)
Re: Magick++ ColorCMYK
Found the issue. I'm compositing the drawn image as an "layer" on top of an transparent image (CMYKA) and the composite (Over) seems to add the transparency (on the brush strokes).
Re: Magick++ ColorCMYK
I was a bit quick on that one. I still get transparent color/stroke when I draw on the image and do nothing else. So draw (rgb) on CMYK image will produce transparent color/stroke on any color.
Re: [SOLVED] Magick++ ColorCMYK
I have finally ported the app to IM7 and to my surprise it now works, no more transparent strokes ![Smile :)](./images/smilies/icon_smile.gif)
![Smile :)](./images/smilies/icon_smile.gif)