🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Flash performance, vector vs bitmap

Published December 29, 2003
Advertisement
First off, I updated the "dancing duck" from days before. If you wanna see this stuff without musical accompaniment, click the duck and he'll cease his endless hula.

Now then, I've been experimenting a bit with bitmaps versus vectors for Flash stuff, just to see how things perform. I actually found something surprising. Despite what people say about Flash being a vector-optimized kind of tool, it does pretty well with bitmaps.

First off, I converted my bitmap duck to vector using VectorEye, as it's the only thing I've found that'll convert a bitmap object into vectors without creating an ugly approximation that's full of holes. It can make a large image, but it does make a good approximation of the bitmap.

Anyway, here's a test I put together. I converted my duck to a single-frame vector image, then wrote a bit of code that scales (between 0% and 200% of original size) and rotates him dynamically. His performance is pretty respectible despite being around a thousand curves, and the file's small at 7921 bytes. . .









Not bad. You can see some banding when he's zoomed in, but I haven't yet found a bitmap/vector convertor that'll do gradients, so that's the price you pay. Anyway, here's the same movie with a bitmap ducky being dynamically scaled and rotated. It's 4,322 bytes and it's actually slightly faster than the vector one (but only very slightly. On my machine I had to let it run for a few minutes before it got ahead of the vector duck).









In other words, even though Flash is put forth as a vector kind of animal, it seems to do well with bitmaps. I presume I could get better performance by optimizing my vector duck. I could probably shrink the size pretty significantly by converting his body to a single closed polygon with a black-to-yellow gradient rather than a buncha little slices, but that's not something I can do manually given that I've got hundreds of frames.

Until then, I guess I'm not gonna be so zealous about making everything into a vector. Bitmaps ain't necessarily a problem.
Previous Entry Yeah it was cool
Next Entry Good find
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement