From 4917a4a8e0bf467ef0faf4bc6748a4a0e7edb69e Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 3 Jan 2022 05:55:10 +0100 Subject: [PATCH] word/edit: decrease webp image quality to 40% Reduce average size from 24kB to 18kB with the same increased resolution, more comparable to 11kB JPEGs. --- Shiar_Sheet/ImagePrep.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shiar_Sheet/ImagePrep.pm b/Shiar_Sheet/ImagePrep.pm index b5038cf..08a9728 100644 --- a/Shiar_Sheet/ImagePrep.pm +++ b/Shiar_Sheet/ImagePrep.pm @@ -41,7 +41,7 @@ sub generate { $cmds //= []; $imgpath->convert($thumbpath, $cmds, '300x200') and # low-res cover $imgpath->convert($thumbpath =~ s/\.jpg$/.webp/r, - $cmds, '600x400' # higher dpi + [@{$cmds}, -quality => 40], '600x400' # higher dpi tradeoff ); } @@ -72,10 +72,10 @@ sub convert { 'convert', $$imgpath, -delete => '1--1', -background => 'white', + '-strip', -quality => '60%', -interlace => 'plane', -gravity => defined $cmds ? 'northwest' : 'center', @cmds, -resize => "$xyres^", -extent => $xyres, - '-strip', -quality => '60%', -interlace => 'plane', $thumbpath ); -- 2.30.0