PDA

View Full Version : Faking anti-aliased


WiseElben
01-05-2004, 11:45 PM
How can you fake anti-aliasing? I'm trying to make a font for my game w/ a border, but it doesn't look good w/o anti-aliasing. I can't use anti-aliasing because the engine reads R: 255 G: 0 B: 128 as transparent, and I can't change the opacity of the text image ingame.

Thanks,
Elben

PS: Attachment is a sample of what I want the font too look like.

EricChadwick
01-06-2004, 04:42 PM
Attachment missing.

Usually the only way to do this is to include the anti-aliasing just within the edges defined by the key color, and anti-alias to a color that is closest to the colors that will be behind the text.

GIF images on websites do this often, using GIF transparency. Here's a rather ugly one that's anti-aliased to gray...
http://www.lysator.liu.se/~zap/presskit/myhead.gif

theGuest
01-06-2004, 10:22 PM
An example image would be nice. Try re-attaching it ok.

You can only fake anti-aliasing if your type is on the small side. At a certain size, the jagged (pixelated) edges will reveal themselves to the eye. Pixel fonts are a good example of this effect/fakery.

You can try to use your engine's transparency colour as the matte colour for your type (that dusty shade of pink). See if that works. But i honestly don't think it will. You'll most likely end up with that colour around the fringes of the letters. But try it anyway so you know for sure.
If you're not sure how to save out an image with transparency, let us know. It's simple.

About the only other sure-fire way that might work is to save your image as a 24bit PNG w/alpha channel. That should produce a very clean result; better than a Gif. However, it's most likely that your game will not accept this format.
If you know it will though, then try that.

:bounce:

ostov
01-09-2004, 11:32 PM
My avatar is a transparency GIF file:D

WiseElben
01-10-2004, 01:09 AM
http://wiseelben.com/images/dreambattlesystem.jpg

My engine saves the images into the engine's personal format. I can't anti-alias the text to the surroundings because the surroundings will be diffrent. The pixels will be visable because the game will use a 640 * 480 screen resolution.

Ahh! Am I doomed?!

Per-Anders
01-10-2004, 05:44 AM
you're pretty much doomed unless you can do varaible alpha, though you could go the route of going for chich lofi pixel art look on the typeface you use.

theGuest
01-10-2004, 11:19 AM
There's no need to anti-alias to the surrounding environment. Not if you use 24bit PNG w/alpha. My engine saves the images into the engine's personal format. So does that mean you cannot use PNG, when saving out from Photoshop? And then let the engine convert that into its own format.

BTW.. cool looking game from what detail i can see in your example image. :thumbsup:

:bounce:

WiseElben
01-10-2004, 04:40 PM
Originally posted by theGuest
There's no need to anti-alias to the surrounding environment. Not if you use 24bit PNG w/alpha. So does that mean you cannot use PNG, when saving out from Photoshop? And then let the engine convert that into its own format.

BTW.. cool looking game from what detail i can see in your example image. :thumbsup:

:bounce:

Even if I save my image to 24bit PNG /w Alpha format, the engine will not be able to read the alpha information, since my alpha blending is done within the engine itself, not the image format.

ou can only fake anti-aliasing if your type is on the small side. At a certain size, the jagged (pixelated) edges will reveal themselves to the eye. Pixel fonts are a good example of this effect/fakery.

I don't think that will work with my engine. You see, my text is actually images. Mabey I can make the images larger, but resize it in the game. Will that help it look smoother?

theGuest
01-11-2004, 12:18 AM
hm... it sounds like your engine is deliberately trying to mess you up! :D

Generally scaling images done tends to smooth them somewhat. To what degree/quality depends on the % of scaling, and level of detail in the image.

Go ahead and try that idea. Can't hurt huh?! :thumbsup:

:bounce:

WiseElben
01-11-2004, 06:40 AM
*sigh* Well, I'll try.

EDIT: Yeay! I don't have to wait for a mod to allow my posts anymore!

Rivendale
01-12-2004, 03:16 PM
Don't know if it's possible in your engine, but maybe you could make the pixels in the outline 50% transparent.

wedge
01-13-2004, 12:16 AM
what about making the image twice the size you need it and scaling it down?

i don't know if that would work for a font, but it's a good way to get rid of jaggies w/o antialiasing in renders.

EricChadwick
01-13-2004, 02:50 PM
Limitation is inherent in the game engine itself. If you only get a one-color alpha, then you'll never get anti-aliasing.

Best bet is to go with mdme_sadie's suggestion about using a good pixel-art style font, one that is optimized for 1-color alpha.

HarlequiN
01-15-2004, 11:06 PM
I've done quite a few fonts for GBA games, which suffer from a similar limitation.

The only way around it that I've found is to anti-alias down to a 1 pixel border around the text. For the GBA I usually keep this black (the GBA's display requires high contrast for decent readability), but in theory the 1 pixel border could be any colour.

It'll still look aliased around the edges, but the actual text itself becomes smooth and readable.

An Example (using 4 colours):

http://www.planetquake.com/polycount/cottages/qbranch/randomstuff/font1.gif

EricChadwick
01-15-2004, 11:23 PM
What a cool idea.

Mr Rino
02-07-2004, 06:50 AM
thats a really nice font harlequin

CGTalk Moderation
01-17-2006, 12:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.