Skip navigation.
 
mlRe: Here is code to Convert RGB <-> HSB
FROM : Nicko van Someren
DATE : Mon Feb 11 23:11:28 2008

On 11 Feb 2008, at 20:22, Duncan Champney wrote:

> My application needs to be able to make HSB adjustments to all the 
> pixels in RGB NSImages that are potentially quite large. (e.g. take 
> an RGB pixel, reduce the brightness by 20%, and increase the 
> saturation by 50%)
>
> The NSColor class has excellent support for this, but you have to 
> create an instance of NSColor for every value you need. I'd need to 
> create several NSColor objects for every pixel on the screen, each 
> time my app updates it's image. This would involved allocating and 
> releasing millions of objects for each screen update.


You could also take a look at CoreImage and in particular the filter 
called CIColorControls, which should let you do this pretty efficiently.

   Cheers,
       Nicko

Related mailsAuthorDate
mlHere is code to Convert RGB <-> HSB Duncan Champney Feb 11, 21:22
mlRe: Here is code to Convert RGB <-> HSB Nicko van Someren Feb 11, 23:11