Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
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 601
 
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.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed.
Including the ones paired with other Macs on your network.
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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:15 AM.

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

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