Re: changing brightness and contrast in an nsimage
Re: changing brightness and contrast in an nsimage
- Subject: Re: changing brightness and contrast in an nsimage
- From: Kenny Leung <email@hidden>
- Date: Sat, 3 Dec 2005 19:12:25 -0800
I would recommend using CoreImage for doing this. There are AppKit
categories on CIImage that are the same as NSImage API. There is also
NSCIImageRep, or rendering your CoreImage into an NSImage. Any or
some combination of these should allow you to slip CIImage into your
system without modifying the rest of your code.
In my application the difference between using NSImage and CIImage
boils down to about 10 lines of code. (After many gyrations - see
previous thread on CIImage performance)
-Kenny
On Dec 3, 2005, at 7:04 PM, Eric Smith wrote:
CIImage wasn't even around until 10.4... there must be a way to
handle this from an NSImage. Anyone out there use brightness and
contrast controls on an NSImage, or the bitmap data associated with
the NSImage?
Thanks,
Eric
On Dec 2, 2005, at 9:34 PM, John C. Randolph wrote:
On Dec 2, 2005, at 9:29 PM, Eric Smith wrote:
I've been going around in circles with this one...
What is a good way to change the brightness and contrast in an
NSImage?
I've been playing with the vImage library for changing contrast,
using the vImageEndsInContrastStretch. This works, but how does
one return the contrast to it's original value? Once you specify
that > 0% of the pixels lie at the histogram extreme, you can't
get the original values back. I know of the ImagApp example
showing how to use CIImage, but using that would require a re-
write of quite a bit of code... I'd rather not go there.
Too bad, because that's how to do it.
-jcr
John C. Randolph <email@hidden> (408) 914-0013
Roaming Cocoa Engineer,
Available for your projects at great Expense and Inconvenience.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40pobox.com
This email sent to email@hidden
_______________________________________________
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