Page 1 of 1

Need help with RGB -> CMY color conversion

Posted: 2009-12-11T05:19:53-07:00
by GerhardBalthasar
Hi everyone and kudos for that great tool!

I tried hard to use convert for a special task, but failed after 8 or more hours, so I ask for your help.

I need to do some kind of color separation with RGB PDFs to CMYK, but with the additional requirement that the black channel must be completly empty afterwards because the black plate is reserved for some special content when the PDF gets processed further (and is printed later). So this is basicly a RGB -> CMY conversion, but result should be written as CMYK with empty K channel.

I tried following ways:

convert in.pdf -colorspace CMYK -channel K -separate -set colorspace CMY -combine -colorspace CMYK

-> leaves me with a complete black page.

convert in.pdf -colorspace CMYK -channel CMYK -separate -set colorspace CMY -combine -colorspace CMYK

-> No black in any color and no black anywhere

Thank you for helping me out!

Greeting,
Gerhard Balthasar

Re: Need help with RGB -> CMY color conversion

Posted: 2009-12-11T10:11:42-07:00
by fmw42
not sure what you mean by a completely "empty" K channel? does that mean every pixel is 0 (black)?

if so try

convert rgbimage -colorspace cmyk -separate \
\( -clone 3 -negate -threshold 0 -negate \) \
-delete 3 -combine cmykimage

second line copies the K channnel and makes it totally black
third line deletes the original k channel, and combines the original cmy with the new k channel for the output

otherwise, explain more what you mean by empty K channel

Re: Need help with RGB -> CMY color conversion

Posted: 2009-12-14T02:28:18-07:00
by GerhardBalthasar
Thank you for trying to help me. I'm from Germany, so exceuse my english and the fact, I wasn't that clear.

Your posted cmdline didn't help, because It gives me a mostly black picture with some colors, this is not what I need. So I'll start over:

Having an image in RGB means that black is coded as 0 R, 0 G and 0 B, where as white is 255 R, 255 G and 255 B. That's fine for monitors, because they work that way.

Okay, now when I want to print out that RGB image that wouldn't work this way because on paper we have CMY (+ K) colors. So without respecting the K channel, black would be coded 255 C, 255 M and 255 Y. Although that black would not really look black, but some sort of brown through the nature of printed colors. That's way professional/offeset printing works with 4 plates, where the fourth plate is the black plate. So to reach a pure black color, 0 C, 0 M and 0 Y is combined with a 255 B.

But for my special case this K black plate needs to be empty after conversion, because the black plate has a fixed content for printing and that black content is not allowed to be disturbed by any other black content from the image I want to print. So the B plate is reserved. As I still want to have some black colors printed from the image, I need to convert the image in a way, where black is mixed up by CMY only and does NOT use any B value.

So I need the conversion of an RGB image into a CMYK image where K is not used and any black is a combination of CMY only, because that converted image is combined later while printing with a fixed black plater content. No other black shall be on this plate or layer but the fixed content. This is why I headlined this thread RGB -> CMY conversion.

I hope this is clear now, if not feel free to ask any question about details,

Greetings,
Gerhard Balthasar

Re: Need help with RGB -> CMY color conversion

Posted: 2009-12-14T10:33:36-07:00
by fmw42
you can convert rgb to cmyk and combine the c,m,y only into a 3channel image. but I don't know what you would do with K to put that info into the cmy channels. nor do I know how you software would handle a 3 channel cmy image. sorry I cannot be any further help. if you want just the cmy 3channel image, try

convert rgbimage -colorspace cmyk -delete 3 -combine cmyimage

Re: Need help with RGB -> CMY color conversion

Posted: 2009-12-17T01:48:46-07:00
by GerhardBalthasar
Thank you for your help,

it turned out, another part of the process makes those problems and I'm about to cure the disease now, not the symptons...

Greetz,
GHad

Re: Need help with RGB -> CMY color conversion

Posted: 2016-11-14T05:12:53-07:00
by LuisF
@Ghad,

Did you figure it out?

Luis