Skip to content Skip to sidebar Skip to footer

Tinting An Image In Pygame

I'm looking on how to tint an image in Pygame in a similar fashion of how Monogame does it. I've been trying to get custom flags like BLEND_ADD to work but it's been hard to find c

Solution 1:

Fill your image with a color and pass one of the BLEND constants as the special_flags argument, e.g. your_image.fill((190, 0, 0, 100), special_flags=pygame.BLEND_ADD).

Note that BLEND_RGB_ADD is just an alias for BLEND_ADD (and the same applies to the other modes). The RGBA modes will also modify the alpha channel (ADD and MAX make transparent parts visible).

Here's a table that shows you the effects of the different blending modes (I've also added the names of the modes in Photoshop):

enter image description here

Post a Comment for "Tinting An Image In Pygame"