Closed rooroodev closed 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"] }
Okay converted .png assets losslessly with highest settings, we're now at 3,592,874 bytes
-> 2,101,704 bytes
(-41%) for image assets
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.
Optimized
.png
assets inassets/action-icons
usingzopflipng
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).