Re: partially convert an nsimage to grayscale
Re: partially convert an nsimage to grayscale
- Subject: Re: partially convert an nsimage to grayscale
- From: Ricky Sharp <email@hidden>
- Date: Fri, 03 Nov 2006 12:04:44 -0800
On Friday, November 03, 2006, at 01:17PM, "Tony O'Callaghan" <email@hidden> wrote:
>Hello everyone,
>I was wondering whether anyone knew how to partially convert an image from
>colour into gray scale. Or to be more precise, I want to convert an image to
>gray scale without however converting the entire image. For example, I want
>to say, for an input, I want any colour image, as an output I want every
>pixel except the ones that i categorise as a certain colour (in this case
>red) to be converted. The purpose of which is to make the red object in the
>image stand out more.
Take a look at the the following sample:
<http://developer.apple.com/samplecode/Monochrome_Image/index.html>
It shows how to apply the NTSC grayscale algorithm. However, it doesn't use direct-pixel access, so will be very slow. Thus, convert it to use direct-pixel-access like the following sample shows:
<http://developer.apple.com/samplecode/Transformed_Image/index.html>
Also definitely take a look at CoreImage where you could write your own grayscale filter to ignore pixels in your color 'range'.
--
Rick Sharp
Instant Interactive(tm)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden