Added test cases. Sampling isn't working as expected yet so test cases removed sampling. Try using bufferedImage.getRGB instead of getting it from bufferedImage.sampleModel