oxipng icon indicating copy to clipboard operation
oxipng copied to clipboard

Not directly related to oxipng, but do you or anyone else know of something that works similarly for .ico files?

Open Jieiku opened this issue 3 years ago • 23 comments

I absolutely love oxipng, it is my new favorite PNG optimizer.

I have been using it like this (Is it possible to get more compression? did I miss any of the advanced options?):

oxipng -o max --strip all -a -Z *.png

I am wondering if there is a tool that does something similar for .ico files? (I still have one of these for old browser compatibility)

Jieiku avatar May 28 '22 20:05 Jieiku

FileOptimizer has a toolchain for .ico.

TPS avatar May 29 '22 00:05 TPS

Seems to be windows software (unless i am wrong?) If anyone know of something that runs on Linux let me know, preferably with the command line but does not have to be.

I can try running this under wine if I get some time to mess around with that.

Just found this: https://jaydenseric.com/blog/favicon-optimization

can probably take the png files from oxipng and merge them into an ico file with imagemagik's convert command

convert 16.png 32.png 48.png favicon.ico

(going to give it a try now)

NOPE it takes my 3 ~130 byte png files and turns them into a 14.7kb huge ico file. Gimp did a better job than this (627kb)

Jieiku avatar May 29 '22 01:05 Jieiku

According to FO's current code, it runs (directly on .ico) in this order

  • magick.exe convert INPUTFILE -quiet -compress ZIP

  • leanify.exe -q -p

Probably tweak those parameters some, as FO changes them based on GUI options. Both tools support Linux.

TPS avatar May 29 '22 13:05 TPS

ahhh good eye, I gave that a go, but does not work:

2022-05-29_12-37-00

It might be the format of the ico that causes it, will see if I can figure it out:

https://github.com/JayXon/Leanify#icon-file-ico

Jieiku avatar May 29 '22 19:05 Jieiku

leanify v0.4.3 is ancient. Have you tried building from current source? Did you try running imagemagick w/ those parameters 1st? I don't hear much from anyone re: optimizing .ico & I've had mixed results myself.

TPS avatar May 30 '22 11:05 TPS

I did look, it seemed to be the latest: https://github.com/JayXon/Leanify/releases (unless I am looking in the wrong places.)

it seems ico support is just not as good as png support: 2022-05-30_05-33-53

Jieiku avatar May 30 '22 12:05 Jieiku

He hasn't released binaries in a very long time. You have to build from source to get 7 years of improvements. Last commit 4 months ago even improved Linux compilation.

TPS avatar May 30 '22 13:05 TPS

Had something come up with a short deadline, going to take another look at this tomorrow. (or possibly this evening)

Jieiku avatar Jun 04 '22 16:06 Jieiku

Gave this a try this evening, but was unable to build, I opened a ticket there though: https://github.com/JayXon/Leanify/issues/84

Jieiku avatar Jun 09 '22 05:06 Jieiku

Yes, my icon was already compressed by GIMP, Leanify took it farther:

./leanify -i 9999 favicon.ico
Processing: favicon.ico
2.59 KB -> 1.90 KB      Leanified: 703 B (26.53%)

The favicon.ico went from 2650 bytes to 1947 bytes.

Thank you very much for recommending, and for prodding me again to try it!

WoW, it even further reduced the size of the png files that I had already processed with oxipng.

Jieiku avatar Jun 09 '22 09:06 Jieiku

No 1 tool is perfect, or even close to it by itself, but using many can approach state-of-the-art. Try FileOptimizer any way you can — it's the best I've found in the last decade or so.

TPS avatar Jun 10 '22 17:06 TPS

FileOptimizer has a toolchain for .ico.

Thank you for suggesting

javiergutierrezchamorro avatar Jun 15 '22 13:06 javiergutierrezchamorro

Thank you for suggesting

@javiergutierrezchamorro Thank you for improving FO all these years. 🙇🏾‍♂️

TPS avatar Jul 13 '22 02:07 TPS

Would be nice if Oxipng added support for .ico, though I get that it's niche. But isn't ICO essentially the same as a png file, just a different structure to support multiple files in one?

Zerowalker avatar Jul 12 '24 04:07 Zerowalker

But isn't ICO essentially the same as a png file, just a different structure to support multiple files in one?

Umm, no. .ico can contain .png, but is otherwise entirely a different format.

TPS avatar Jul 13 '24 02:07 TPS

Would be nice if Oxipng added support for .ico, though I get that it's niche.

You're essentially looking for leanify, which is designed to also work on archive formats, which .ico practically is.

FileOptimizer might be even better.

TPS avatar Jul 13 '24 21:07 TPS

Maybe you could suggest leanify adopt oxipng 😄 FileOptimizer does include it now.

andrews05 avatar Jul 13 '24 21:07 andrews05

But isn't ICO essentially the same as a png file, just a different structure to support multiple files in one?

Umm, no. .ico can contain .png, but is otherwise entirely a different format.

That's basically what I meant, but thought it was only png files, so my bad:)

Zerowalker avatar Jul 15 '24 10:07 Zerowalker