Skip to content

Instantly share code, notes, and snippets.

@fernandospr
Last active September 19, 2016 18:57
Show Gist options
  • Save fernandospr/00c3025d2ae576356ee09b58edf7889b to your computer and use it in GitHub Desktop.
Save fernandospr/00c3025d2ae576356ee09b58edf7889b to your computer and use it in GitHub Desktop.
First pixel white check
import javax.imageio.ImageIO;
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
...
public static boolean isFirstPixelWhite(String imageFilename) throws IOException {
BufferedImage image = ImageIO.read(new File(imageFilename));
int color = image.getRGB(0, 0);
return color == Color.WHITE.getRGB();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment