File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes Can not get individual pixel values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Can not get individual pixel values" Watch "Can not get individual pixel values" New topic

Can not get individual pixel values

Mahesh Chavan

Joined: Jun 17, 2012
Posts: 1
I want to know individual alpha red blue and green values of a pixel. Following code displays image from a file ( given as first argument ) but does not show any rgba vaures ( all values returned are 0 )
Pl. let me know what is the error in the code :

I have also tried to get rgba values in a array int rgba[] form. But I am always getting zero values for all pixels.
Please help.
Darryl Burke

Joined: May 03, 2008
Posts: 4523

Hello Mahesh, and welcome to the Ranch! Please BeForthrightWhenCrossPostingToOtherSites


Also, the code you copied and added to has been around for more than 12 years*. I suggest you go through the Swing trail of the Oracle tutorials, where you will find updated sample code that (a) respects Swing's single threaded rule and (b) doesn't use methods that have been deprecated since that coed was written.


luck, db
There are no new questions, but there may be new answers.
subject: Can not get individual pixel values
Similar Threads
Logical operation on Image
Number of colors in an Image
Dealing with images
Image smoothing