Skip to content

Instantly share code, notes, and snippets.

@fernandospr
Last active September 19, 2016 18:57
Show Gist options
  • Select an option

  • Save fernandospr/00c3025d2ae576356ee09b58edf7889b to your computer and use it in GitHub Desktop.

Select an option

Save fernandospr/00c3025d2ae576356ee09b58edf7889b to your computer and use it in GitHub Desktop.

Revisions

  1. fernandospr revised this gist Sep 19, 2016. 1 changed file with 8 additions and 0 deletions.
    8 changes: 8 additions & 0 deletions gistfile1.java
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,11 @@
    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);
  2. fernandospr renamed this gist Sep 19, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. fernandospr created this gist Sep 19, 2016.
    5 changes: 5 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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();
    }