Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Lighten or darken BufferedImages, or Images?

 
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: 42970
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.
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!