Changing transparency values in Paint.net automatically changes colour as well

571 Views Asked by At

For the game I'm developing, the levels are encoded as .png files with each pixel representing a tile and the colour encoding which tile. In order to try and encode more information in this level file, I hoped to change the transparency of certain pixels accordingly, then in the code I could extract the colour from its transparency, find the right tile and do whatever additional functionality is implied by the transparency value (e.g. add a shadow for that tile or whatever). The problem is, changing transparency values in Paint.net which is the tool I'm using for .pngs also changes the colour, e.g. ff7C3038 is the original solid colour with ff being the transparency value. If I then change this to aa7C3038 in the programme and fill in the desired area it seems to work, except that using the colour picking tool on the area shows the fill colour to be aa7C3037 instead of aa7C3038. The effect is not constant and seems to depend on the darkness of the colour, with light colours actually working as intended and darker colours being even further off. My question is, is there any workaround for this in Paint.net, and if not is there a recommended alternative tool to use? Suggestions for how to solve my original problem are also welcome, although I've considered simply having extra files for extra level information and would prefer if there were a way to do it this way.

1

There are 1 best solutions below

0
On

No one answered in 6 months, so I will tell you about my site, that to me is the perfect companion to Paint.Net:

https://pixeldatabase.net

My site was originally a Windows Application called Transparency Maker, but I put it online to make it easier for everyone to use.

In this example, I get rid of the black background:

Before Image: enter image description here

Bitmap Query Language or BQL for short:

Hide
Total < 50

Where Total equals the sum of Red + Green + Blue:

Result:

enter image description here

It looks white here because this page is white.

To me this is a really simple way to remove backgrounds.