Java - get pixel array from image

后端 未结 7 1059
面向向阳花
面向向阳花 2020-11-22 03:52

I\'m looking for the fastest way to get pixel data (int the form int[][]) from a BufferedImage. My goal is to be able to address pixel (x, y) from

相关标签:
7条回答
  • 2020-11-22 04:42

    This worked for me:

    BufferedImage bufImgs = ImageIO.read(new File("c:\\adi.bmp"));    
    double[][] data = new double[][];
    bufImgs.getData().getPixels(0,0,bufImgs.getWidth(),bufImgs.getHeight(),data[i]);    
    
    0 讨论(0)
提交回复
热议问题