调整Java中BufferedImage的亮度和对比度

我正在使用一些框架来处理一堆图像,我所有的都是一堆Buffered Image对象.不幸的是,这些图像真的很暗,我想让它们变亮,调整对比度.

就像是:

BufferedImage image = something.getimage();
image = new Brighten(image).brighten(0.3); // for 30%
image = new Contrast(image).contrast(0.3);
// ...

有任何想法吗?

解决方法

实际上很简单.
RescaleOp rescaleOp = new RescaleOp(1.2f,15,null);
rescaleOp.filter(image,image);  // Source and destination are the same.

1.2的缩放因子和15的偏移似乎使得关于停止的图像更加明亮.

好极了!

阅读更多在the docs for RescaleOp.

相关文章

最近看了一下学习资料,感觉进制转换其实还是挺有意思的,尤...
/*HashSet 基本操作 * --set:元素是无序的,存入和取出顺序不...
/*list 基本操作 * * List a=new List(); * 增 * a.add(inde...
/* * 内部类 * */ 1 class OutClass{ 2 //定义外部类的成员变...
集合的操作Iterator、Collection、Set和HashSet关系Iterator...
接口中常量的修饰关键字:public,static,final(常量)函数...