Color picking from an Image

Problems with Canvas, OpenGL, etc...

Color picking from an Image

Postby Cyberfreak » Thu Dec 22, 2011 12:19 pm

Hi Guys,
I am new to the android platform and I am urgently in need of some help in extracting colors from an image (preferably JPEG) and use the color for later process. Help me, Anybody Pls...
Cyberfreak
Freshman
Freshman
 
Posts: 2
Joined: Thu Dec 22, 2011 11:35 am

Top

Re: Color picking from an Image

Postby MichaelEGR » Thu Dec 22, 2011 2:59 pm

Load your image into a Bitmap and use the getPixels methods:
http://developer.android.com/reference/ ... Pixels(int[], int, int, int, int, int, int)

The integers grabbed can be used with Color. You can even convert to HSV from the various methods in the Color class.
Founder & Principal Architect; EGR Software LLC
http://www.typhonrt.org
http://www.egrsoftware.com
User avatar
MichaelEGR
Senior Developer
Senior Developer
 
Posts: 147
Joined: Thu Jan 21, 2010 5:30 am
Location: San Francisco, CA

Re: Color picking from an Image

Postby Cyberfreak » Fri Dec 23, 2011 4:48 am

Thank you for the Immediate response . will try it today....
Cyberfreak
Freshman
Freshman
 
Posts: 2
Joined: Thu Dec 22, 2011 11:35 am

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 1 guest