Jump to content
  • Advertisement
  • entries
    1212
  • comments
    1738
  • views
    1144392

Flash performance, vector vs bitmap

Sign in to follow this  
johnhattan

135 views

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.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!