File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Random pixels from a BufferedImage... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Random pixels from a BufferedImage..." Watch "Random pixels from a BufferedImage..." New topic
Author

Random pixels from a BufferedImage...

tim charles
Greenhorn

Joined: Oct 09, 2009
Posts: 13
What would be the most efficient way to grab a number of random pixels (RGB value) from a BufferedImage. Preferably equidistant from each other.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39537
    
  27
By "random", do you mean actually random x and y values, or just that they could be any x and y values? For the latter, check out the getRGB(int, int) method. The former could be implemented by feeding random values into the two parameters of that method, although that wouldn't address the equidistant constraint.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Random pixels from a BufferedImage...
 
Similar Threads
characteristics of JSON web services
IndexColorModel
steganography app
Setting java.awt.Image background color
changing gray pixels....