# Using Slick2D/LWJGL to brighten an Image

Using the Slick2D Library for Java, I want to know if there is a way to brighten an instance of org.newdawn.slick.Image. I'm willing to use other image-manipulation libraries if need be.

I can imagine a few different ways to do this, but which one is the best will depend on your particular situation.

First of all, if it is possible to perform this offline using some image editing software then that would probably give the best result and result in better performance for your application. However, I am guessing that this is not possible in your situation.

Now, the easiest and most efficient online solution that I can come up with would be to simply render the image multiple times using additive blend mode. (g.setDrawMode(Graphics.MODE_ADD)). If you need precise control of the brightness you might be able to render the image with a different alpha value as an intermediate step and then use the result to add to your output image. Here is a small example

dark = new Image("media/dark.jpeg");

bright = new Image(dark.getWidth(), dark.getHeight());
Graphics g = bright.getGraphics();
g.drawImage(dark, 0.0f, 0.0f);