Discuss Scratch

ScodexPerson
Scratcher
100+ posts

Decreasing project size

My browser / operating system: Windows NT 10.0, Chrome 143.0.0.0, No Flash version detected
So i've seen people say that the projects are to big in filesize to add stuff in it. But as an person who knows alot about storage in Pc's, i know a few ways to (maybe) decrease the filesize:
- Compressing images, costumes with defragmentation software, NOTE: only useful when the images themself are >10MB
- Making names shorter (eg: Sprite, costumes, variables etc.)
- Using as few blocks as possible (quite well known)
- Compressing sounds. NOTE: There is an high chance that the sounds might be ballooned by Scratch, as pointed out by TweetytheBird93

—EXAMPLES—
This is a stack of blocks, and if the stack is 3 blocks or taller, don't do this:
create clone of [something v]
create clone of [something v]
create clone of [something v]
Instead, do this:
repeat (3)
create clone of [something v]

end
Here are a few variables:
(Clicked? +10)
(AliveState)
(Horizontal speed)
The names are quite long, so do this instead:
((clk) + (10))
(Alve)
(Xspd)
Here is an custom block:
define Position Player | X: (Xposition) | Y: (YPosition) | Size: (Size)
As you can see, the name is quite long, so do this instead:
define Pos (X) (Y) (SZE)
Please, if you know another way to decrease filesize, reply here.
-ScodexPerson

Last edited by ScodexPerson (Jan. 21, 2026 12:46:34)

redspacecat
Scratcher
1000+ posts

Decreasing project size

Compressing images won't help unless the images themselves are over 10 MB.
A bigger costume doesn't make the project JSON bigger.
ScodexPerson
Scratcher
100+ posts

Decreasing project size

redspacecat wrote:

Compressing images won't help unless the images themselves are over 10 MB.
A bigger costume doesn't make the project JSON bigger.
Ok, i will add a note to the costumes part.
TweetytheBird93
Scratcher
35 posts

Decreasing project size

compressing sounds might work (this is a common issue in big projects) although i think it's better NOT to edit sounds after you import them since scratch's sound system balloons the filesize up with no possible way of reversing it
edit: scratch converts mp3's (small size) to wav files (large size) when edited so

Last edited by TweetytheBird93 (Jan. 22, 2026 13:39:05)

Voxalice
Scratcher
1000+ posts

Decreasing project size

Some projects have too much code to save properly.

Internally, every Scratch project is a .zip file, and that .zip archive contains a file called project.json. This file contains all of the project's code.

The project.json file can only be 5 megabytes or less in size, which is too much for most projects to be affected. However, some projects are affected anyway, so @Vadik1's project.json minimizer can be used to reduce the file's size.

Techniques like condensing scripts and shortening variable names may help with project speed, but in terms of file size, you're probably only saving a few bytes when you make a change like that. They're not very useful, unless you're really close to one of the project size limits. Also, shortening names tends to make code less readable.

Last edited by Voxalice (Jan. 24, 2026 14:18:29)

CST1229
Scratcher
1000+ posts

Decreasing project size

Voxalice wrote:

(#5)
Some projects have too much code to save properly.

Internally, every Scratch project is a .zip file, and that .zip archive contains a file called project.json. This file contains all of the project's code.

The project.json file can only be 5 megabytes or less in size, which is too much for most projects to be affected. However, some projects are affected anyway, so @Vadik1's project.json minimizer can be used to reduce the file's size.

Techniques like condensing scripts and shortening variable names may help with project speed, but in terms of file size, you're probably only saving a few bytes when you make a change like that. They're not very useful, unless you're really close to one of the project size limits. Also, shortening names tends to make code less readable.
Large variables and lists can make up a good portion of the project.json data. Costumes don't (they just take up the same amount regardless of costume content), so for read-only data it's possible to write a “scanning” script that reads the data from costumes or backdrops when the project runs.

Also, TurboWarp performs some project.json compression by default, though not as much as Vadik1's tool for extension compatibility (e.g i don't think it compreses variable IDs).
MonkeyBean2
Scratcher
500+ posts

Decreasing project size

CST1229 wrote:

Large variables and lists can make up a good portion of the project.json data.
It's also worth noting that monitors store a copy of variables/lists, which are only updated when the monitor is visible.

Powered by DjangoBB