I'm trying to make a night effect for my game in Pygame. So I'm gonna blit a black image on the screen then, change its blending mode to Difference
just like in Photoshop in order to make the screen look darker. However, I still don't know how to do that as I haven't used the blending modes in Pygame yet. Any help ?
How to get the Difference blending mode?
343 views Asked by Developeeer At
1
The blending mode can be changed by setting the optional special_flags argument of
pygame.Surface.blit
:e.g.:
Unfortunately, Pygame doesn't have a blending mode that gives the absolute difference of 2 images. However it can be achieved with
MAX(SUB(image1, imgage2), SUB(image2, image1))
e.g.: