Sprite strips and project size

Discussion and feedback on Construct 2

Post » Thu May 24, 2012 2:00 pm

Hi All,

I haven't found this information in my searches of the forums, so here goes...

I have been using the "import sprite strip" function because it's a quick and easy way to get animations into C2. Up until now, I haven't thought much about its impact on project size.

I have the same sprite strip in 2 different formats, PNG-8 (150Kb) and JPEG (65Kb). The strip is 6 cells long. I have tested importing each format into C2 using "import sprite strip" and have gotten new estimates of project size that don't make sense to me.

When I import the PNG-8, the project size estimate increases by 400Kb. When I import the JPEG, the project size estimate increases by 600Kb. This is a larger increase than I was expecting. Also, it seems odd to me that the JPEG strip, which is smaller, would increase the project size more than the PNG-8.

So, here's my question: What is the exact process when a sprite strip is imported? Specifically, what does C2 save besides the original sprite strip?

Knowing this would help me to decide whether to import the frames one at a time.

Thanks so much for any help, and, as always, thanks for a wonderful tool in C2!
B
12
S
5
G
5
Posts: 26
Reputation: 4,001

Post » Thu May 24, 2012 2:20 pm

Remember the estimate is only a guess: the only way to know for real is to actually export your project, which will run various CPU intensive compression algorithms and compact the project size down. More info in this blog post. The estimate is pretty crude since it doesn't do all that work.

When you import images, regardless of the format of the image, C2 stores it in the project as PNG-32. This is what the estimated size measures, so there should be no difference between importing a PNG-32, a PNG-8 or a JPEG on the estimated size.

You can set a different export format in the image editor. It's still PNG-32, but will be recompresed to either PNG-8 or JPEG upon exporting if you use this option. It's not automatically set, so if you import a JPEG it will still export a PNG-32 unless you click the image format button and change it to JPEG.

The export format is not currently taken in to account in the estimated size, but for the next build I've changed it: PNG-8 will be estimated to be half the size, and JPEG will be estimated to be a quarter the size. Again those are pretty arbitrary guesses, so you'd have to export to know for sure.

Hope that helps!Ashley2012-05-24 14:21:27
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Thu May 24, 2012 2:28 pm

Thanks for the quick reply, Ashley! This is a helpful summary of the format issues. I should've tested some actual exports before I posted. I will try that shortly to get some more data.

Specific to the sprite strip importer: can you say quickly what it does to the strip during the import? Is it slicing it into pieces and resaving individual files for every cell?
B
12
S
5
G
5
Posts: 26
Reputation: 4,001

Post » Thu May 24, 2012 2:44 pm

Yeah, it will slice each frame in to a separate PNG-32 file. Save as a folder project and browse the files to see what it's doing.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578


Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans, Televangelist and 4 guests