|
Semi-Transparency (dither) |
|
|
Welcome student. Today we will cover a very basic concept which can come in real handy
if you are working with low end devices or if you just plan on using oldschool techniques
instead of relying on alpha transparencies. |
|
![]() Meet our test subject, Djin-na. You can call him 'jina' for short I suppose. |
• Djin-na has volunteered to be our test subject for this demonstration. By nature, he is of an ethereal nature, as he is a wind-spirit who does not quite dwell on this plane of existence, but rather the ethereal plane. His visage is semi-transparent by nature. Heres the problem, however. We dont have any alpha channels to set transparency. How do we fake this with a simple .gif file which saves things as with an indexed palette of no more than 256 colors? |
![]() ![]() ![]() ![]() Here we use two different dither patterns to overlay ontop of jina, one a '1/2' pattern, the other a '1/4' pattern. |
• To start, let us make a dithered tile with a simple pattern. It matters not what color
you use, as long as you dont use that color in the image you wish to apply a semi-transparency towards.
Once this is done, overlay this tile ontop of the desired image |
![]() ![]() Fill in all the surrounding pixels with the same color that you used to dither and set that index as the transparent index color. This is the result |
• After you have overlain this pattern ontop of your image, fill the background color you used
for your original image to the same color you used as the dither pattern, which in this example was
a bright yellow. |
![]() ![]() ![]() ![]() Overlaying jina on st0ven... (in a non-sexual way of course), you can view the visibility that each pattern has yielded |
• To test our visibility, lets stick st0ven behind the ethereal jina. You can clearly
see that the '1/2' pattern gives more visibility behind the image than the '1/4' frequency
dither. If you used something with a pattern frequency greater than 1/2, you will find that
you will be able to see more clearly 'through' the image/sprite in question. |
| Back | |