Compressing assets to reduce size #24

Closed
opened 4 months ago 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.

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.
PrincipalSpears added the
enhancement
Medium Priority
needs more info
labels 4 months ago
Collaborator

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.
PrincipalSpears changed title from Convert backgrounds to jpg to reduce size to Compressing assets to reduce size 4 months ago

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.

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

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.

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.

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
PrincipalSpears removed the
needs more info
label 4 months ago

theres a branch called compress for this. Waiting for #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

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.

fun.

fun.

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.
PrincipalSpears added this to the Patchy-Patch5 Release milestone 4 months ago

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

ok got it done lmao, scream at me if this is broken.
PrincipalSpears closed this issue 4 months ago
Sign in to join this conversation.
No project
No Assignees
4 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.