Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 9, 2013, 02:34 PM   #1
printz
macrumors regular
 
Join Date: Dec 2012
Get pixel data from an image?

I'm trying to make a photomosaic generator for OSX. What I need is to be able to get direct bitmap/pixel data from images (so I can determine the average colour of a mosaic tile), but NSImage seems too high level for this. Any help please? The Apple documentation about drawing looks huge and has lots of variants (Cocoa, Quartz, OpenGL) I'd prefer Cocoa here.
printz is offline   0 Reply With Quote
Old Sep 9, 2013, 04:41 PM   #2
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
Get your image as a NSBitmapImageRep then use colorAtX:y: on it.
__________________
Don't tell me Macs don't last: 2007 iMac, 2007 Mac Mini, 2008 MacBook Air, all Vintage.
(iMac obsoletion: April 28, 2015, MBA: October 14, 2015, Mac Mini: March 9, 2016)
ArtOfWarfare is offline   0 Reply With Quote
Old Sep 9, 2013, 04:46 PM   #3
subsonix
macrumors 68030
 
Join Date: Feb 2008
From an NS image you can extract an image representation and then get bitmap data pointed to by an unsigned char pointer.
subsonix is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone 6 Camera May Feature Electronic Image Stabilization, Bigger Pixel Size MacRumors MacRumors.com News Discussion 158 May 6, 2014 02:07 PM
Copy EXIF data from one image to another themumu Digital Photography 3 Aug 21, 2013 12:54 PM
Image data from Internet antdawe iPhone 2 Mar 10, 2013 01:13 PM
Retina MacBook Pro Data - Image Retention tom. MacBook Pro 6 Sep 19, 2012 06:41 AM
image data corrupted error hajira iPhone 0 Aug 23, 2012 12:27 AM

Forum Jump

All times are GMT -5. The time now is 11:48 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC