0

Since the image rendering system I'm using in PyGame doesn't recognize transparency, I filled all my spritesheets with RGB(0, 255, 0), defined transparent as (0, 255, 0) in my config.py file, and added self.sprite.set_colorkey(transparent) in my get_sprite function. However, for some reason, the program that I use for pixel art, Piskel, exports sprites with weird colour inaccuracies, changing the colour ever so slightly in seemingly random pixels. This causes a bunch of green dots to surround my sprites. All of these colour discrepancies have a value of (4, 252, 4) and I've defined that as transparentextra in my config file but I don't know how to implement it in the colorkey part of the get_sprite function. Is it possible to have two colours in colorkey, and if not, is there a better way to fix this? The different greens are impossible to differentiate with the human eye so I can't just replace them with the correct green.

kecenr
  • 31
  • 1
  • 8
  • *"Is it possible to have two colours in sprite.set_colorkey in the PyGame module?"* No it is not. Use an image format with an alpha channel. (e.g. [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) files) – Rabbid76 Jun 22 '21 at 17:52

0 Answers0