简体   繁体   English

使用Java着色的黑白缓冲图像

[英]Making black & white buffered images colored in java

I'v been making a game in java from scratch and have recently come to an issue when trying to color black and white BuffereImages. 我一直在用Java从头开始制作游戏,最近在尝试为黑白BuffereImages上色时出现问题。 I want to keep the darkness of the pixels (if that makes any sense). 我想保持像素的暗淡(如果有任何意义)。 For example, the grass in Minecraft is a gray image, but when seen in game it comes in different shades of green, but keeps its value. 例如,《我的世界》中的草是灰色图像,但是当在游戏中看到时,它以不同的绿色阴影出现,但保持其价值。 I don't have any code to show because I don't know where to start. 我没有任何代码可显示,因为我不知道从哪里开始。 All I have is a couple BufferedImages that I want to color. 我只有两个要着色的BufferedImages。 Thanks. 谢谢。

Use Color.getHSBColor() to find a gamut of saturations or values for a given hue, as shown here for saturation. 使用Color.getHSBColor()找到饱和或值的色域为给定的色调,如这里的饱和度。 Use a suitable LookupOp to update the the image, as shown in the articles cited here . 用合适的LookupOp更新的图像,如图中所引用的文章在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM