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

WordPress Trac noreply at wordpress.org
Wed Feb 2 04:58:14 UTC 2022


#55036: Sharpen thumbnails with Imagick adaptiveSharpenImage()
-------------------------+-----------------------------
 Reporter:  galbaras     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Media        |    Version:  5.9
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The Imagick function `resizeImage()` often produces thumbnails with a low
 visual quality (blurry/grainy). The world is moving to small high-
 resolution devices, where visual quality makes a difference, and we need
 something better.

 Fortunately, `adaptiveSharpenImage()` (see
 https://www.php.net/manual/en/imagick.adaptivesharpenimage.php) sharpens
 the subject/foreground of the image, while not sharpening the background
 (as much).

 I've tested it with various `sigma` values, and `1` got me a nice enough
 result (`radius` was `0` == auto). However, it would be good to test
 ranges of image sizes and ranges of scaling ratios (original size /
 thumbnail size) to find out more.

 For even more flexibility, there should be filters on the default values
 of `radius` and `sigma`. This will allow developers to have finer control
 on specific sites that need a bit more.

 Alternatively, `add_media_size()` can be extended to accept `radius` and
 `sigma`, which can then be used during thumbnail generation. This will
 also be a convenient way for developers to update the sharpening settings
 of existing media sizes.

 Option: when Imagick is used, add `radius` and `sigma` fields to the
 definition of image sizes in Settings > Media -OR- in the customizer for
 site-specific control without coding.

 See also: #40415

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


More information about the wp-trac mailing list