Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert CMYK to RGB/YCbCr and back, as lossless as possible?

115 views
Skip to first unread message

Jace

unread,
Jun 12, 2009, 9:46:34 AM6/12/09
to
I need to process some image data in YCbCr color space, because I need
brightness and color information separated. I can convert back and
forth between RGB and YCbCr without significant loss (just minor
rounding/precision limits), no problem there. However, when I try to
do the same with CMYK images, I'm getting in trouble.

Since CMYK has one more channel than RGB or YCbCr, there are obviously
different CMYK values that will result in the same RGB or YCbCr
values. So converting back will not always result in the original CMYK
values. This may not always be a problem, since CMYK colors are
somewhat ambiguous, that is, they have 'overlap': different CMYK
values can represent the same color.

My question: how can I convert from CMYK to RGB or YCbCr and back,
with minimal loss. I realize this also depends on the color profile of
the CMYK image, unfortunately in my case I don't have access to that.
But I can implicitly assume a general, 'common' CMYK profile, such as
"U.S. Web Coated (SWOP) v2" (Adobe Photoshop's default when working
with CMYK images).

[Jongware]

unread,
Jun 12, 2009, 10:26:57 AM6/12/09
to

Conversion between RGB and 'pure' CMY is lossless -- it might work for
you. But don't use it for a real world application of the CMY values;
the 'lossless' conversion doesn't use black *at all* and assumes 100%
pure inks. It might not be a problem, because you are (probably)
assuming your monitor displays RGB 'for real' as well. ('Black' is not
necessary if C,M, and K are pure; just as a zero value for R,G,B should
display a black hole pixel on your monitor -- which it doesn't.)

The simple conversion can be found on
http://local.wasp.uwa.edu.au/~pbourke/texture_colour/convert/

[Jw]

Martin Leese

unread,
Jun 12, 2009, 10:51:27 AM6/12/09
to
Jace wrote:
> I need to process some image data in YCbCr color space, because I need
> brightness and color information separated. I can convert back and
> forth between RGB and YCbCr without significant loss (just minor
> rounding/precision limits), no problem there. However, when I try to
> do the same with CMYK images, I'm getting in trouble.
>
> Since CMYK has one more channel than RGB or YCbCr, there are obviously
> different CMYK values that will result in the same RGB or YCbCr
> values. So converting back will not always result in the original CMYK
> values. This may not always be a problem, since CMYK colors are
> somewhat ambiguous, that is, they have 'overlap': different CMYK
> values can represent the same color.
>
> My question: how can I convert from CMYK to RGB or YCbCr and back,
> with minimal loss.

You may find this previous thread in this
newsgroup helpful:
http://groups.google.ca/group/sci.image.processing/browse_thread/thread/8b3f9167617d65e3/8b1646a2f3450a80?hl=en&q=RGB+CMYK+author:martin+author:leese#8b1646a2f3450a80

As you have already realized, CMYK to RGB
loses information. Therefore, in general,
it cannot be done with minimal loss.

--
Regards,
Martin Leese
E-mail: ple...@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/

Jace

unread,
Jun 12, 2009, 10:51:53 AM6/12/09
to
On Jun 12, 4:26 pm, "[Jongware]" <so...@no.spam.net> wrote:
> Conversion between RGB and 'pure' CMY is lossless -- it might work for
> you. But don't use it for a real world application of the CMY values;
> the 'lossless' conversion doesn't use black *at all* and assumes 100%
> pure inks.

Well, this *is* for a real world application :)
And my CMYK input certainly does have (blac)K data as well.

> It might not be a problem, because you are (probably)
> assuming your monitor displays RGB 'for real' as well. ('Black' is not
> necessary if C,M, and K are pure; just as a zero value for R,G,B should
> display a black hole pixel on your monitor -- which it doesn't.)

If there was just CMY, it wouldn't be a problem. I could convert that
to RGB by simple inversion, do my thing, and invert back to CMY. No
loss there.
(The fact that RGB = inverted CMY does actually not represent the same
real color does not matter here, since that 'thing' I'm doing is not
sensitive to that, and I'm converting back anyway)

But CMYK -> RGB/YCbCr -> CMYK, is a whole different story. I need this
conversion to lose as little as CMYK-information as possible.

bugbear

unread,
Jun 12, 2009, 11:32:31 AM6/12/09
to

Is it possible to extract the brightness and color information
and then apply it to the original CMYK data?

Are you processing images or general graphic; this is quite
important, since graphics may well have careful
choking and bleeding applied by the designer to deal
with registration issues.

BugBear

Jace

unread,
Jun 12, 2009, 12:26:13 PM6/12/09
to
On Jun 12, 5:32 pm, bugbear <bugbear@trim_papermule.co.uk_trim> wrote:
> Is it possible to extract the brightness and color information
> and then apply it to the original CMYK data?

I'm afraid not, no.

> Are you processing images or general graphic;

Both (I'm processing 'any' image, which can be photos, drawings, etc)

> this is quite important, since graphics may well have careful
> choking and bleeding applied by the designer to deal
> with registration issues.

Not sure what you mean with 'registration issues'? (is it easy to show
an example?)

bugbear

unread,
Jun 12, 2009, 12:27:36 PM6/12/09
to

If you're messin' with CMYK (which is for print), I suggest
you look up "choke" and "bleed" and "registration"
before going much further.

BugBear

Jace

unread,
Jun 13, 2009, 4:00:22 AM6/13/09
to

Thanks. From what I've found, the choking/trapping and bleeding won't
be an issue with what I'm doing.

The registration marks however (you mean with 'full ink', 100C 100M
100Y 100K, right?) would be a problem though, as I don't see a way to
convert this to RGB and back and still distinguishing 'registration
black' and regular black.

When experimenting in Photoshop, I noticed that when I have a CMYK
image and I put completely black & white (well, grayscale) content in
it, it still puts stuff in the CMY channels as well, whereas I'd
expect it would use the K channel only (same result, at least if you
stick to the image's ICC prpfile, and costs less ink). Is there some
default convention as for how to represent certain colors or grayscale
shades in CMYK?

Kenneth Sloan

unread,
Jun 20, 2009, 11:30:08 AM6/20/09
to

This does not follow: Even if there is *some* loss (i.e., not ZERO), it
is still worth asking how to achieve MINIMAL loss.

--
Kenneth Sloan Kennet...@gmail.com
Computer and Information Sciences +1-205-932-2213
University of Alabama at Birmingham FAX +1-205-934-5473
Birmingham, AL 35294-1170 http://KennethRSloan.com/

toby

unread,
Jun 20, 2009, 5:24:27 PM6/20/09
to
On Jun 13, 4:00 am, Jace <Jace_tbl_...@yahoo.com> wrote:
> Thanks. From what I've found, the choking/trapping and bleeding won't
> be an issue with what I'm doing.

Correct. Trapping is almost irrelevant to halftones.

>
> The registration marks however (you mean with 'full ink', 100C 100M
> 100Y 100K, right?) would be a problem though, as I don't see a way to
> convert this to RGB and back and still distinguishing 'registration
> black' and regular black.
>
> When experimenting in Photoshop, I noticed that when I have a CMYK
> image and I put completely black & white (well, grayscale) content in
> it, it still puts stuff in the CMY channels as well, whereas I'd
> expect it would use the K channel only (same result, at least if you
> stick to the image's ICC prpfile, and costs less ink). Is there some
> default convention as for how to represent certain colors or grayscale
> shades in CMYK?

The parameters for the conversion vary widely. Photoshop gives you
control over separation method (UCR/GCR - which is used depends on
local practice, process, and varies dramatically by continent); total
ink weight depends on many mechanical details of the process, as does
black ink limit. Trial and error, and thorough consultation with your
lithographic print supplier, is necessary to find good settings for
the printing process, source imagery, etc.

It is possible to enable 100% GCR in Photoshop which will render a
monochrome image on the black plate alone, but this is usually not
desirable for practical reasons. For example, the black plate alone
does not reach the same visual density on paper that a combination of
four inks can. And this kind of configuration may increase sensitivity
to trapping issues as bugbear mentioned.

0 new messages