Advertisement
Guest User

Untitled

a guest
May 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. int red = new long[256];
  2. int blue = new long[256];
  3. int green = new long[256];
  4.  
  5. for (int y = 0; y < image.getImage().getHeight(); y++) {
  6.             for (int x = 0; x < image.getImage().getWidth(); x++) {
  7.                 int redCount = (int)(pr.getColor(x, y).getRed()*255);
  8.                 int blueCount = (int)(pr.getColor(x, y).getBlue()*255);
  9.                 int greenCount = (int)(pr.getColor(x, y).getGreen()*255);
  10.                 int averageCount = ((int)(pr.getColor(x, y).getGreen()*255) +
  11.                                    (int)(pr.getColor(x, y).getRed()*255) +
  12.                                    (int)(pr.getColor(x, y).getBlue()*255))/3;
  13.                
  14.                 red[redCount]++;
  15.                 blue[blueCount]++;
  16.                 green[greenCount]++;
  17.                
  18.                 rgb3[averageCount]++;
  19.             }
  20.         }
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement