For my project I am trying to create an ImageThumbNail class that takes whatever image and shrinking it down to exactly 50x50. I have code that only shrinks the image, but it doesn't get the pixels down to exactly 50x50.
private static int[][] thumbNailSingleChannel(int[][] pixelArray) {
int rows = pixelArray.length/2;
int columns = pixelArray[0].length/2;
int[][] answer = new int[rows][columns];
for (int r = 0; r < rows; r++) {
for (int c = 0; c < columns; c++) {
answer[r][c] = pixelArray[r*2][c*2];
}
}
return answer;
}