Commit 3f1f5895 authored by Fabian Vogt's avatar Fabian Vogt

generate_wallpaper_sizes.py: Properly compress wallpapers

The current options are quite bad and result in files which are unnessarily
big, even bigger than the original file. The Pillow documentation says:
> Values above 95 should be avoided; 100 disables portions of the JPEG
> compression algorithm, and results in large files with hardly any gain
> in image quality.

"100" is not a valid value for the subsamping parameter either.

This change actually enables proper compression with subsampling and also
enables optimization of internal settings.

Result: From 34MiB down to 12MiB with no noticable difference.
parent 0a8a4bd1
......@@ -43,4 +43,4 @@ for orientation in ('horizontal', 'vertical'):
else: box = None
resized_image = image.resize((width, height), Image.LANCZOS, box)
resized_image.save(base_dir / f'{width}x{height}{extension}',
quality=100, subsampling=100)
quality=90, optimize=True, subsampling=1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment