Posterization for Blue Color

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fred Ho
    New Member
    • Oct 2007
    • 18

    Posterization for Blue Color

    I know how to do posterization for image processing, such as below...

    public BufferedImage doPosterization (BufferedImage inputImage,
    int posterizationVa lue) {
    short[] posterize = new short[256];

    for (int i = 0; i < 256; i++) {
    posterize[i] = (short) (i - (i % posterizationVa lue));
    }

    BufferedImageOp op = new LookupOp(new ShortLookupTabl e(0, posterize),
    null);
    BufferedImage mBufferedImage = op.filter(input Image, null);
    return mBufferedImage;
    }

    But how to do posterzation just on blue element? where the posterization value will be inputted by the user.
    Thanks!
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Look at the other constructor of ShortLookupTabl e.

    Comment

    Working...