Manipulating a colored image in matrix form in java

后端 未结 1 1090
慢半拍i
慢半拍i 2021-01-24 04:09

I am working on a project related to colored image manipulation using JAVA.

I got to know the conversion of the colored image into a matrix using a getSample method of

相关标签:
1条回答
  • 2021-01-24 04:42

    You may be looking or java.awt.image.LookupOp, which uses a java.awt.image.LookupTable to modify bands en bloc. Several examples are cited here. The image below illustrates inversion:

    short[] invert = new short[256];
    for (int i = 0; i < 256; i++) {
        invert[i] = (short) (255 - i);
    }
    BufferedImageOp invertOp = new LookupOp(new ShortLookupTable(0, invert), null));
    invertOp.filter(src, dst);
    

    image

    0 讨论(0)
提交回复
热议问题