KonaeAkira / raphael-rs

Crafting rotation optimizer / macro generator for Final Fantasy XIV
https://www.raphael-xiv.com/
Apache License 2.0
67 stars 14 forks source link

Reduce action icon asset size #79

Closed rooroodev closed 3 weeks ago

rooroodev commented 3 weeks ago

Optimized .png assets in assets/action-icons using zopflipng with maximum settings - reduced folder size from 3,592,874 bytes -> 2,754,452 bytes (-23% size) and should be visually lossless/identical.

settings used were --iterations=500 --filters=01234mepb --lossy_8bit --lossy_transparent

I attempted other image formats such as webp but they are not compatible with egui, so I think this may be as small as these get.

Many actions use the same skills between jobs and could potentially use the same .png but whether its worth putting dev time into is debatable (probably not worth).

KonaeAkira commented 3 weeks ago

egui uses the image crate to handle image decoding. WebP should be supported, but you need to enable the corresponding feature flag in Cargo.toml:

image = { version = "0.24.9", default-features = false, features = ["webp"] }
rooroodev commented 3 weeks ago

Okay converted .png assets losslessly with highest settings, we're now at 3,592,874 bytes -> 2,101,704 bytes (-41%) for image assets

rooroodev commented 3 weeks ago

webp icons were compressed using the python pillow library - settings used: lossless = True method = 6 (Quality/speed trade-off (0=fast, 6=slower-better). Defaults to 4.) quality = 100 (0 is fastest, 100 slowest best quality)

Looking back, method/quality when lossless is enabled might be the same thing.