What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Converting image with semi-transparent pixels to 256 colors


Darkloke

New Member
Messages
1
Likes
0
Greetings. I hope you could help me with the following subject.

I am trying to find a "perfect" way (for myself) to convert an image from RGB PNG with transparency to 256 indexed colors format. I am trying to mod a very old game and images there support only 256 colors format with palettes. Specifically i am interested what things i could try to "smooth" out borders with semi-transparent pixels... what methods or tricks could help so the indexed image could resemble original as maximum as possible.

When i am saying above "indexed image could resemble original as maximum as possible" i mean this is only regarding borders with semi-transparent pixels. Since my images are quite small, we arent talking about color losing problem in conversion process, this is not a subject of my question.

Here some thoughts and things i already tried.

1. First of all i use layer mask from transparency -> threshold -> 1 to receive "original black matte" from the existing transparency of the original image. As i understand doing so allows to me to preserve maximum original image information before next step.
2. Reduce image to 44x52 using bicubic (smooth gradients) interpolation. That reduce method was pure my choice based only on my observations, i personally dont like additional sharpness from other methods.
3. Duplicate layer. Trick about duplicating layer as well as thresholding layered mask i randomly got from adobe community forum here. In my case i have only 1 duplicate of the layer, but the question of "how many of them should be" is still unanswered for me.

This are the base steps i do. And now i usually open history tab and switch between last two steps (duplicate layer and indexed colors) to see how resulting image changes from the original. This is the stage where i think i have to do something else to smooth the difference. All other operations i tried i made on the "bottom" layer, so the "top" one could "smooth" results. Tried median, various blurs, defringe and something else.

I hope i stated my question more or less clearly... And here are images i am now experimenting with.

Assassin's Dagger.png

Ax.png

Crookhorn Longbow.png

Longsword.png

Quarterstaff.png
 
Greetings. I hope you could help me with the following subject.

I am trying to find a "perfect" way (for myself) to convert an image from RGB PNG with transparency to 256 indexed colors format. I am trying to mod a very old game and images there support only 256 colors format with palettes. Specifically i am interested what things i could try to "smooth" out borders with semi-transparent pixels... what methods or tricks could help so the indexed image could resemble original as maximum as possible.

When i am saying above "indexed image could resemble original as maximum as possible" i mean this is only regarding borders with semi-transparent pixels. Since my images are quite small, we arent talking about color losing problem in conversion process, this is not a subject of my question.

Here some thoughts and things i already tried.

1. First of all i use layer mask from transparency -> threshold -> 1 to receive "original black matte" from the existing transparency of the original image. As i understand doing so allows to me to preserve maximum original image information before next step.
2. Reduce image to 44x52 using bicubic (smooth gradients) interpolation. That reduce method was pure my choice based only on my observations, i personally dont like additional sharpness from other methods.
3. Duplicate layer. Trick about duplicating layer as well as thresholding layered mask i randomly got from adobe community forum here. In my case i have only 1 duplicate of the layer, but the question of "how many of them should be" is still unanswered for me.

This are the base steps i do. And now i usually open history tab and switch between last two steps (duplicate layer and indexed colors) to see how resulting image changes from the original. This is the stage where i think i have to do something else to smooth the difference. All other operations i tried i made on the "bottom" layer, so the "top" one could "smooth" results. Tried median, various blurs, defringe and something else.

I hope i stated my question more or less clearly... And here are images i am now experimenting with.

View attachment 149175

View attachment 149176

View attachment 149177

View attachment 149178

View attachment 149179
Do you need the final file to be in PNG-8 format with embedded variable levels of transparency? If yes, Photoshop does not support PNG-8 with multiple levels of transparency, as I understand. It only allows for one encoded color table value to be fully transparent.

If you are simulating limited total colors with multiple levels, I am pretty sure that can be done PNG-24, yet I did not want to go down that path if you need PNG-8 format.

Other software does support PNG-8 with multiple levels of transparency. ImageMagick is one such program.

Let me know what path you plan to take.
John Wheeler
 

Back
Top