File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Random pixels from a BufferedImage...

 
tim charles
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic