Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting an image between color spaces (e.g. RGB To CMYK)




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

This email sent to email@hidden
References: 
 >Converting an image between color spaces (e.g. RGB To CMYK) (From: "R. Scott Thompson" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.