Applying transformations to NSBitmapImageRep
Posted
by Adam
on Stack Overflow
See other posts from Stack Overflow
or by Adam
Published on 2010-06-03T03:49:40Z
Indexed on
2010/06/03
3:54 UTC
Read the original article
Hit count: 187
objective-c
|cocoa
So ... I have an image loaded into an NSBitmapImageRep object, so I am able to examine the contents of specific pixels via a two dimensional array. Now I want to apply a couple of "transformations" to the image, in preparation for some additional processing. If I was manipulating the image manually, in Photoshop, I would:
- Rotate the image
- Crop a portion of it and discard the rest
- Apply a "threshold" transformation (which essentially converts the image to black and white, based on the threshold value I provide)
- Resample the image to shrink it down a bit (which, although losing some image quality, will speed up the subsequent processing)
(not necessarily in that order)
Are there objective C methods available to facilitate these specific image manipulations, with the data in the NSBitmapImageRep object? If so, can someone point me to some good examples?
© Stack Overflow or respective owner