Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. import java.awt.image.BufferedImage;
  2. import javax.imageio.ImageIO;
  3. import java.io.File;
  4. import java.io.IOException;
  5. import java.math.BigInteger;
  6.  
  7. public class Tapper_get {
  8.     public static void main(String[] args) throws IOException {
  9.         File file = new File(args[0]); //E:\\Projects\\Vlados_fight\\image\\test1.png
  10.         BufferedImage image = ImageIO.read(file);
  11.         String binary = new String();  
  12.         for(int x = 0; x<image.getWidth();x++)
  13.             for(int y=image.getHeight()-1;y>=0;y--)
  14.                 binary += (image.getRGB(x, y)==-1) ? "0" : "1";
  15.         BigInteger final_result=new BigInteger(binary, 2);
  16.         System.out.println(final_result.multiply(BigInteger.valueOf(17)));
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement