Advertisement
Guest User

Untitled

a guest
Jun 13th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. double getPixels(double X, double Y, double rad, Image thisImage) {
  2.  
  3. PixelReader r = thisImage.getPixelReader();
  4. int count = 0;
  5. double c = 0;
  6. // Determine the color of each pixel in the image
  7. for (int readY = 0; readY < thisImage.getHeight(); readY++) {
  8. for (int readX = 0; readX < thisImage.getWidth(); readX++) {
  9.  
  10. count++;
  11. Color color = r.getColor(readX, readY);
  12. c += ((color.getRed() + color.getGreen() + color.getBlue()) / 3);
  13. // color.getSaturation());
  14.  
  15. }
  16.  
  17. }
  18.  
  19. return c / count * 256;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement