PDA

View Full Version : Flash performance and image slicing


danee987
04-08-2010, 04:40 PM
Say I have a 800x600 canvas in photoshop, with a 200x200 square in the middle of the canvas, the rest is transparent. Now say I were to save thid out as an 800x600 .png file with transparency for flash instead of cutting out a 200x200 jpg of the square. Then say I take this 800x600 .png into flash, make about 12 movieclips out of it and animate them. Would flash take more of a performance hit as opposed to bringing in a 200x200 square jpg?? I'm wondering if anyone ever tried this?

Reason I ask is because I see some people cutting out huge png files the size of the entire canvas even though the image is tiny. Then animating that big png all over the stage. To me that doesn't seem right. Wouldn't flash have a harder time animating a large image like that even though most of the area is just transparency? Any one have any clue?

anfractuosities
04-09-2010, 04:14 AM
not totally sure how flash's compressor works...but logically...
jpg compress much smaller than pngs..not only this, but the png file is a waste of space...

but again, if flash compresses everything anyway...it might not make a difference, but why is it necessary to use the whole 800x600 image anyway?

danee987
04-12-2010, 04:05 PM
it doesnt make sense to me to save the whole image as a png like that. but i've noticed it being done. it is convenient because if any changes are needed you dont need to adjust the slice or selection to save the image out. but yea. so much transparency for no reason? hmmmm

adninjastrator
04-12-2010, 04:28 PM
I'd recommend resizing outside of Flash to the exact size needed on the Flash stage. Why waste the resources? and I think it's a "best practice" to have everything correctly sized before bring into Flash.
And just to test, I created a 800 X 600 png with a 200 X 200 red square in it. Size 6KB.
A 200 X 200 .png, also with a 200 X 200 red square, 4KB.
Using the larger one brings in an image that is 150% in file size.
Best wishes,
Adninjastrator

danee987
04-12-2010, 08:37 PM
I made some tests and yes in fact first of all anything that has transparency runs A LOT slower than non transparent relatively speaking of course. A png that has transparent stuff runs slower than a png that has no transparent stuff. Jpegs to me ran as fast as png's that had nothing transparent on them. And the larger the transparent area the more of a performance hit flash takes. Interesting stuff. I always figured this was true but never really had looked into it or made tests. Good to know:) And yea like you said file size definitely is definitely a difference.