Java - Brightness


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public BufferedImage brightness(BufferedImage bi, float value)
  2. {
  3. BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());
  4.  
  5. Kernel kernel = new Kernel(1, 1, new float[] {value});
  6.  
  7. ConvolveOp op = new ConvolveOp(kernel);
  8. op.filter(bi, buff);
  9.  
  10. return buff;
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.