• Post Reply Bookmark Topic Watch Topic
  • New Topic

Lighten or darken BufferedImages, or Images?  RSS feed

 
Braden Steffaniak
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried RescaleOp, however all that seems to do is purplify the BufferedImage. I am looking for something that looks like you are placing a 25% opaque black sheet over an image, a 50% and a 75%. And not a purple sheet.

Heres the code of what I was doing before:



All it seems to do is make it more purple. Is there anything else that will work?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can blend two images with a given alpha (which would be 0.25, 0.5 or 0.75 in your case) like this:

Provided one of the images is completely black, this should produce the desired output.
 
Braden Steffaniak
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That will work, thanks.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!