简体   繁体   中英

Change color in java.awt.Image?

I have an java.awt.Image object. It is an colorful image. Here is my code:

ImageIcon icon = new ImageIcon(bytes);
Image image = icon.getImage();

How can I make it black & white?

Look into using a BufferedImageOp. See Drawing an Image in the Java Tutorials for more details.

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