简体   繁体   中英

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. 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. Thanks.

Use Color.getHSBColor() to find a gamut of saturations or values for a given hue, as shown here for saturation. Use a suitable LookupOp to update the the image, as shown in the articles cited here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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