Compressing assets to reduce size #24

Closed
opened 2021-06-15 19:18:50 +00:00 by StellarStellas · 13 comments

The backgrounds are about 100 MB of the 550 MB total. Most of the backgrounds are just photos run through a filter anyway so converting them to jpg isn't going to lose much detail. I did a quick conversion of all the backgrounds and it drops to ~25 MB. I eyeballed the results and I can't tell the difference from the originals, even for the non-photo backgrounds.

The backgrounds are about 100 MB of the 550 MB total. Most of the backgrounds are just photos run through a filter anyway so converting them to jpg isn't going to lose much detail. I did a quick conversion of all the backgrounds and it drops to ~25 MB. I eyeballed the results and I can't tell the difference from the originals, even for the non-photo backgrounds.
Owner

I did suppose doing this to the artists and they kinda didn't like the idea because they were afraid of quality loss. Though, I wouldn't mind having some more backing to counterbalance the artist's wishes. If it can be sufficently proven there is no loss of user experience from this change to the artists, I think they would be fine with it.

I did suppose doing this to the artists and they kinda didn't like the idea because they were afraid of quality loss. Though, I wouldn't mind having some more backing to counterbalance the artist's wishes. If it can be sufficently proven there is no loss of user experience from this change to the artists, I think they would be fine with it.
MichaelYick added the
enhancement
Medium Priority
needs more info
labels 2021-06-15 23:28:32 +00:00
Member

I know this is to reduce the image sizes, but there might be an argument to revisit why certain songs are in .wav, making just two of them take up 55 MBs. If there is a good reason for them to be as they are, it's fine. If not, we could convert them to high bitrate mp3/ogg/whatever and probably gain around 30 MB back.

I know this is to reduce the image sizes, but there might be an argument to revisit why certain songs are in .wav, making just two of them take up 55 MBs. If there is a good reason for them to be as they are, it's fine. If not, we could convert them to high bitrate mp3/ogg/whatever and probably gain around 30 MB back.
MichaelYick changed title from Convert backgrounds to jpg to reduce size to Compressing assets to reduce size 2021-06-16 08:50:23 +00:00
Owner

updated title of post to reflect the nature of the issue.

Sound for sure could be made into the ogg format to reduce some filesize. I doubt a simple ffmpeg conversion would do much harm.

updated title of post to reflect the nature of the issue. Sound for sure could be made into the ogg format to reduce some filesize. I doubt a simple ffmpeg conversion would do much harm.
Author

Don't know what we can do for the backgrounds other than converting and have the artists check if they're fine with the results?
On linux I just ran

for IMG in *.png; do convert "$IMG" "$IMG.jpg"; done

in the backgrounds folder to convert everything using imagemagick. There are some settings you can tune (and other tools as well), but even this looks good to me.
Some of the backgrounds end up with some dark lines at the edges but I think that's because the original backgrounds have some transparency there.

For the audio, yeah you should just convert everything to ogg vorbis or opus, you won't notice the difference and it will be much smaller.

FYI there's a bunch of unused assets that are still being shipped, e.g.

  • 28 MB alarm /game/audio/effects/336640__audiojacked__alarm-air-raid-siren-test-devonport-sony-pcm-m-10
  • 6 MB zip /game/audio/prom_chatter_loop_2.zip
    so those are easy wins
Don't know what we can do for the backgrounds other than converting and have the artists check if they're fine with the results? On linux I just ran ``` for IMG in *.png; do convert "$IMG" "$IMG.jpg"; done ``` in the backgrounds folder to convert everything using imagemagick. There are some settings you can tune (and other tools as well), but even this looks good to me. Some of the backgrounds end up with some dark lines at the edges but I think that's because the original backgrounds have some transparency there. For the audio, yeah you should just convert everything to ogg vorbis or opus, you won't notice the difference and it will be much smaller. FYI there's a bunch of unused assets that are still being shipped, e.g. - 28 MB alarm `/game/audio/effects/336640__audiojacked__alarm-air-raid-siren-test-devonport-sony-pcm-m-10` - 6 MB zip `/game/audio/prom_chatter_loop_2.zip` so those are easy wins
Owner

for loop for imagemagick

pls just mogrify *.png -verbose -format jpg and save yourself the code typing.

also linux is a kernel, how are you running userland applications on it ;)

original backgrounds have some transparency there.

should we keep those pngs or just use webps for those? I am leaning towards webps with low compression but I know people get really mad about those for some reason.

For the audio, yeah you should just convert everything to ogg vorbis or opus, you won't notice the difference and it will be much smaller.

Probably will end up doing this. Seems like an easy fix.

may end up making the compression branch soon enough. Patchy-patch5 is going to get tons of love.

>for loop for imagemagick pls just `mogrify *.png -verbose -format jpg` and save yourself the code typing. also linux is a kernel, how are you running userland applications on it ;) >original backgrounds have some transparency there. should we keep those pngs or just use webps for those? I am leaning towards webps with low compression but I know people get really mad about those for some reason. >For the audio, yeah you should just convert everything to ogg vorbis or opus, you won't notice the difference and it will be much smaller. Probably will end up doing this. Seems like an easy fix. may end up making the compression branch soon enough. Patchy-patch5 is going to get tons of love.
Author

pls just mogrify *.png -verbose -format jpg and save yourself the code typing.

pls no bully. lel I don't work with this stuff too often so I just went with the simplest thing I knew.

original backgrounds have some transparency there.

should we keep those pngs or just use webps for those?

I'm pretty sure it's just a mistake from when the backgrounds were generated, it's a small strip (3px) at the right edge. I think we should just fix it and use jpg.

> pls just mogrify *.png -verbose -format jpg and save yourself the code typing. pls no bully. lel I don't work with this stuff too often so I just went with the simplest thing I knew. > > original backgrounds have some transparency there. > should we keep those pngs or just use webps for those? I'm pretty sure it's just a mistake from when the backgrounds were generated, it's a small strip (3px) at the right edge. I think we should just fix it and use jpg.
Owner

I'll make a PR for this soon enough then for people to check out and make complaints about. I don't know how happy the artists will be, but if the worst thing thats being seen in quality loss is werid stuff on the edge, then I doubt we'll be in trouble

I'll make a PR for this soon enough then for people to check out and make complaints about. I don't know how happy the artists will be, but if the worst thing thats being seen in quality loss is werid stuff on the edge, then I doubt we'll be in trouble
MichaelYick removed the
needs more info
label 2021-06-18 05:56:35 +00:00
Owner

theres a branch called compress for this. Waiting for https://git.snootgame.xyz/Cavemanon/SnootGame/pulls/17 to be merged before making a PR

theres a branch called compress for this. Waiting for https://git.snootgame.xyz/Cavemanon/SnootGame/pulls/17 to be merged before making a PR
Owner

Gitea is giving me a 500 error when trying to make a PR to merge the compress branch in with Patchy-Patch. Anyone mind doing it?

Note that it shaves off 300MB~ and also still needs some tweaking to fit in with the rest of the script.

Gitea is giving me a 500 error when trying to make a PR to merge the compress branch in with Patchy-Patch. Anyone mind doing it? Note that it shaves off 300MB~ and also still needs some tweaking to fit in with the rest of the script.

Tried several times now, also getting a 500 error.

Tried several times now, also getting a 500 error.
Owner

fun.

fun.
Owner

could always do a merge on my end. You guys can check the branch out and whatnot. I guess I will work on it solo and merge it into patchy patch.

could always do a merge on my end. You guys can check the branch out and whatnot. I guess I will work on it solo and merge it into patchy patch.
MichaelYick added this to the Patchy-Patch5 Release milestone 2021-06-20 04:31:52 +00:00
Owner

ok got it done lmao, scream at me if this is broken.

ok got it done lmao, scream at me if this is broken.
Sign in to join this conversation.
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Cavemanon/SnootGame#24
No description provided.