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).
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]
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/
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.
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
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?)
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
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?
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/
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.