Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double getPixels(double X, double Y, double rad, Image thisImage) {
- PixelReader r = thisImage.getPixelReader();
- int count = 0;
- double c = 0;
- // Determine the color of each pixel in the image
- for (int readY = 0; readY < thisImage.getHeight(); readY++) {
- for (int readX = 0; readX < thisImage.getWidth(); readX++) {
- count++;
- Color color = r.getColor(readX, readY);
- c += ((color.getRed() + color.getGreen() + color.getBlue()) / 3);
- // color.getSaturation());
- }
- }
- return c / count * 256;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement