Help needed to greatly reduce size of SVN repo images.
Albert Astals Cid
aacid at kde.org
Mon Apr 15 22:10:46 BST 2024
El dijous, 11 d’abril del 2024, a les 13:07:40 (CEST), Martin Rys va escriure:
> Hey there,
>
> there are about 3700 PNGs in the SVN repo, totalling 200MB.
> I aim to reduce that greatly, losslessly, without losing any data or
> quality, while keeping the PNG format.
>
> 200MB may not seem like much, but such files exist there:
> * 2MB PNG that reduces to 1MB
> * 900KB PNG that reduces to 30KB
>
> Basically, the total savings are huge, kwin alone loses about 5MB in
> total package size on Arch Linux after these optimizations - Arch
> ships packages including documentation.
>
> To achieve this, I am in need of someone with a developer account that
> can either just send in changed files, or someone who would run oxipng
> for every PNG in the repo as per https://rys.rs/optimization if they
> have the CPU power and time.
>
> At the time of writing, it is:
> oxipng --zopfli --opt max "${filepath}"
I have run
find -name *.png | parallel oxipng --opt max --preserve {} \;
over trunk
I have *not* included --zopfli because the time wasted on it is ridiculous,
e.g. running it over
./l10n-kf6/it/docs/khelpcenter/fundamentals/visualdict-gui1.png
goes from 5 seconds to 675 seconds.
Cheers,
Albert
>
> Maybe it would be good to also add:
> --preserve
> Preserve file permissions and timestamps if possible
>
> This losslessly optimizes the PNG file, but it is *very* demanding on
> CPU time, so it either needs a lot of threads(think threadripper), or
> a lot of time, or both.
>
> This does not delete EXIF data (--strip would, not desired).
> Wiping EXIF would save some % more, but that is a bit controversial -
> we would need to decide what to keep (Author field and possibly more),
> it is mildly dangerous, and can always be done later if desired.
> The savings from getting rid of EXIF shouldn't be that interesting in
> the end, unless something is wrong and there is excessive metadata
> stored, I have not looked if that is the case yet.
>
> If nobody steps up in a few days, Tosky said they'd give it a try on
> the Matrix channel.
>
> P.S. Yes, there are images in the translations repo! They are mostly
> screenshots of UI for the given localization. They are used sparsely,
> maybe an entirely different, automated system to create them would be
> a good idea, maybe with a switch to SVG/JXL to save on size, but the
> aim of this thread is to reduce size of the currently existing PNGs.
>
> Martin
More information about the kde-i18n-doc
mailing list