Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shrink/ losslessly compress ICO resource files to reduce size of apps published with SingleFile/AOT #11370

Open
elachlan opened this issue May 14, 2024 · 4 comments · May be fixed by #11375
Open
Labels
area-ILLinker/AOT area-Trimming tenet-performance Improve performance, flag performance regressions across core releases

Comments

@elachlan
Copy link
Contributor

In #9911 it was discovered that the embedded ICO resource files have a non-trivial size and could be losslessly compressed upwards of 90% of original file size.
329946128-158858e8-7497-4b0e-86cd-c4e49bc39de4

We should use GIMP or similar tool to shrink each of the ICO files and maybe investigate the use of PNG to reduce file sizes.

@elachlan elachlan added tenet-performance Improve performance, flag performance regressions across core releases area-Trimming area-ILLinker/AOT labels May 14, 2024
@elachlan
Copy link
Contributor Author

I was able to shrink alignment.ico from 54kb to 10kb. But Image Magick required extracting them first and then recombining.

@MichalStrehovsky
Copy link
Member

I was able to shrink alignment.ico from 54kb to 10kb. But Image Magick required extracting them first and then recombining.

alignment.ico can be 2.5 kB. ImageMagick will still store them as BMP for some reason (with a smaller bit depth, but still uncompressed BMP). Try this instead:

sudo apt install imagemagick --install-recommends
sudo apt install icoutils
convert alignment.ico alignment.png
icotool -c -o alignment-new.ico -r alignment-0.png -r alignment-1.png -r alignment-2.png -r alignment-3.png -r alignment-4.png -r alignment-5.png -r alignment-6.png

@JeremyKuhne
Copy link
Member

If we don't lose individual icon sizes and the rendered bitmap is identical, then I'm fine with this.

@elachlan
Copy link
Contributor Author

The process we used unpacks the icon into individual image files for each size contained. Then converts the images to png to compress them and repacks them into the ico. As far as I could tell they are identical on the files I checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ILLinker/AOT area-Trimming tenet-performance Improve performance, flag performance regressions across core releases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants