Weird unexpected colors ? (transparent?)

Hello, I never played with Tiled before today. I spent the whole day doing a pretty big map, and everything is wrong when I load it into my pygame RPG. The first image is how I see it in Tiled, the second image is what actually shows up when I load it.


I have already tried changing the “trans” argument in the text editor of the .tmx file to “000000”, “ffffff00” and “ff00ff” none of which work, but they have slight variations (some have the glitched parts with pink and yellow, others just white/black).

Can someone please explain what is going on and how I can fix my map or at least avoid this mistake in future maps?

I tried other tile sets to make sure it’s not a problem with these specific assets. I get the same problem. See images:

In Tiled:
image

In pygame:

I also asked the question on StackOverflow : .tmx files weird colors in Pygame (python) - Tiled - Stack Overflow

trans="000000"
Turns out I had to completely delete the trans argument (bold part) now everything is working fine!

1 Like

Hey @William_Bourgeois, welcome to the Tiled forum!

Indeed trans="000000" means black would be your transparent color. Maybe Pygame ignores the alpha channel when it sees that a transparent color is set, though that doesn’t seem to explain all of the behavior, especially not why the grass was not visible in your first ingame screenshot.

Btw, to unset the transparent color there is a checkbox when editing the Image of the tileset:

So when you run into this in the future, you don’t have to resort to editing the file in a text editor. :slight_smile: