Re: Decompressing JPEG data into specific format, getting raw pixels
Re: Decompressing JPEG data into specific format, getting raw pixels
- Subject: Re: Decompressing JPEG data into specific format, getting raw pixels
- From: Doug Hill <email@hidden>
- Date: Tue, 15 Aug 2017 09:41:25 -0700
Check out CoreImage ColorControls filter, which has a Saturation parameter:
https://developer.apple.com/library/content/documentation/GraphicsImaging/Reference/CoreImageFilterReference/#//apple_ref/doc/filter/ci/CIColorControls
<https://developer.apple.com/library/content/documentation/GraphicsImaging/Reference/CoreImageFilterReference/#//apple_ref/doc/filter/ci/CIColorControls>
"To calculate saturation, this filter linearly interpolates between a grayscale
image (saturation = 0.0) and the original image (saturation = 1.0).”
Doug Hill
> On Aug 15, 2017, at 9:23 AM, Sean McBride <email@hidden> wrote:
>
> I get some JPEG data from the network. I want to efficiently decompress this
> data into a specific format (8 bit greyscale) and have an NSData of the raw
> pixels. What's the best way to do this?
>
> I'm currently using NSBitmapImageRep initWithData:, then testing if the
> result is greyscale or RGB. If the latter, I write my own loop to convert to
> greyscale.
>
> But I'm hoping there is some lower level API available that I can tell
> explicitly that I want greyscale...
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden