DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Java - Brightness

11.03.2006
| 9540 views |
  • submit to reddit
        
public BufferedImage brightness(BufferedImage bi, float value)
	{
		BufferedImage buff = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());
		
		Kernel kernel = new Kernel(1, 1, new float[] {value});
		
		ConvolveOp op = new ConvolveOp(kernel);
		op.filter(bi, buff);
		
		return buff;
	}