我正在使用一些框架处理一堆图像,而我得到的只是一堆BufferedImage
对象。不幸的是,这些图像真的很暗,我想把它们调亮并稍微调整一下对比度。
就像是:
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.
A scaleFactor
1.2 和offset
15 似乎使关于停止的图像更明亮。
Yay!
阅读更多内容的文档RescaleOp http://download.oracle.com/javase/6/docs/api/java/awt/image/RescaleOp.html.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)