[wp-trac] [WordPress Trac] #55036: Sharpen thumbnails with Imagick adaptiveSharpenImage()

WordPress Trac noreply at wordpress.org
Thu Jan 19 22:37:28 UTC 2023


#55036: Sharpen thumbnails with Imagick adaptiveSharpenImage()
-------------------------+---------------------
 Reporter:  galbaras     |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  6.2
Component:  Media        |     Version:  5.9
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+---------------------

Comment (by craigfrancis):

 A few tests would be recommended (not all images are improved by
 sharpening, but we might find most thumbnails could be); there is a
 performance risk; and a possible "[https://docs.ewww.io/article/124
 -sharpening-images 10% of an increase in file size]".

 The patch might need to provide a way to toggle this feature on/off, and
 customise the radius/sigma.

 Checking the EWWW Image Optimizer plugin ([https://github.com/nosilver4u
 /ewww-image-
 optimizer/blob/acd8256fccd17984a819686fce51c90199fbfa58/classes/class-
 ewwwio-imagick-editor.php#L436-L441 lines 436 to 441]):

 * `ewww_image_optimizer_sharpen` appears to be off by default (as an
 aside, [https://github.com/nosilver4u/ewww-image-
 optimizer/blob/acd8256fccd17984a819686fce51c90199fbfa58/classes/class-
 ewwwio-imagick-editor.php#L437 eio_use_adaptive_sharpen] is also false by
 default, but [https://github.com/nosilver4u/ewww-image-
 optimizer/blob/acd8256fccd17984a819686fce51c90199fbfa58/common.php#L2592
 eio_enable_adaptive_sharpen] seems to ignore this second step, and instead
 does a check for 1.5+ MP images);
 * Used with JPEG images ([https://github.com/nosilver4u/ewww-image-
 optimizer/blob/acd8256fccd17984a819686fce51c90199fbfa58/unique.php#L3105-L3107
 WebP images are done separately]);
 * Checks the Imagick extension supports this method (via is_callable,
 although 6.2.9 is pretty old now);
 * Sets a ''default'' radius of 0 (auto-select);
 * Sets a ''default'' sigma of 1 (or [https://github.com/nosilver4u/ewww-
 image-
 optimizer/blob/acd8256fccd17984a819686fce51c90199fbfa58/common.php#L2607
 0.5 for 0.25+ MP images]);
 * Changes from FILTER_TRIANGLE to [https://github.com/nosilver4u/ewww-
 image-
 optimizer/blob/acd8256fccd17984a819686fce51c90199fbfa58/common.php#L2559
 FILTER_LANCZOS] for 2.0+ MP images.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55036#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list