Skip to content Skip to sidebar Skip to footer

How Can You Edit The Brightness Of Images In Pygame?

I'm trying to make an OpenGL in python/pygame but I don't know how to add shadow. I don't want to make a lot of darker images for my game. Can someone help me?

Solution 1:

I am no expert in Python but you could try:

Multiply the color of the image by a value like 0.1, 0.2, 0.3 (anything less that 1) which will give you a very dark texture. This would be the easiest method as it involves just reducing the color values of that texture.

Or you could try a more complex method such as drawing a transparent black quad over the original image to give it the illusion of being in a shadow.

Post a Comment for "How Can You Edit The Brightness Of Images In Pygame?"