y_nk
y_nk

Reputation: 2275

Antialiasing algorithm

I'm looking for a good way to antialias a bitmap i'm generating with actionscript3. My goal would be to achieve this processing from scratch.

I read a lot on the subject but the most common algorithm are looking too heavy to work properly within my swf, because i'm using a scale2x algorithm to smooth the edges of my shape. It doesn't have to be colorfull, since my shape is black and white !

Any hint would be appreciated, thanks :)

Upvotes: 1

Views: 926

Answers (2)

davr
davr

Reputation: 19147

Draw your shape at 2x the size, then simply scale it down to 1/2 the size, relying on Flash itself to do the smoothing. If you need more smoothing, increase the factors (3x + 1/3, etc). You didn't give very many details on what exactly you are drawing, so this may or may not be fast enough, you'll have to try it out.

PS: In the future, if you want more answers to your questions, don't mark one of the answers as accepted. People will skip your question if they see you already accepted one answer.

Upvotes: 1

Joa Ebert
Joa Ebert

Reputation: 6715

Xiaolin Wu's line algorithm is what you could use. It is fast and easy to implement.

Upvotes: 2

Related Questions