From: Mischa POSLAWSKY Date: Mon, 3 Jan 2022 04:55:10 +0000 (+0100) Subject: word/edit: decrease webp image quality to 40% X-Git-Tag: v1.13~49 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/4917a4a8e0bf467ef0faf4bc6748a4a0e7edb69e?ds=sidebyside 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. --- 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 );