Would it be possible to save screenshots in svg/vector format instead of bitmaps? JPG screenshots are often so compressed, that there are artifacts all over, especially with images that use many colors.
Pygame cannot do vectors as it’s not vector based.
You could make it save in other formats including non-compressed
See etc-system.py screengrab()