On May 13, 2005, at 7:17 PM, R. Scott Thompson wrote:
Please forgive my ignorance on Color Management issues. I am
learning, if slowly. :-)
If I have a CGImage and I would like to convert it from one color
space to another, what is the most effective way to do that?
Since the routine CGImageCreateCopyWithColorSpace requires that the
two color spaces have the same number of components, I am working
under the presumption that all it really does is create a new image
that shares the pixel data of the first image, but associates that
data with another color space. In essence it is taking the same
image data and looking at it from the perspective of the second
color space.
If I need to convert to another color space, with a different
number of components (i.e. RGB to Grayscale, or CMYK to RGB) what
is the most efficient mechanism? Do I need to create a pixel
buffer, and a CGContext that uses the desired color space, then
draw the image into that context and create my new image from the
result? Or is there a more direct path?
This is the recommended and only available path through Quartz.
Alternatively, you could go directly to ColorSync and convert the
bitmap data directly.
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden