[wp-trac] [WordPress Trac] #63448: Image quality significantly degrades for resized PNGs with transparency in WordPress 6.8.1
WordPress Trac
noreply at wordpress.org
Mon Jun 9 16:08:21 UTC 2025
#63448: Image quality significantly degrades for resized PNGs with transparency in
WordPress 6.8.1
-------------------------------------------------+-------------------------
Reporter: elvismdev | Owner:
| adamsilverstein
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 6.8.2
Component: Media | Version: 6.8
Severity: critical | Resolution:
Keywords: has-patch has-test-info has-unit- | Focuses:
tests changes-requested |
-------------------------------------------------+-------------------------
Comment (by siliconforks):
Replying to [comment:87 SirLouen]:
> @siliconforks got your point
>
> Anyway, can you refresh to me the reason of quantizing and then forcing
`png8` afterwards, specifically for greyscale images? I remember there was
a reason, but I've read through the thread, but I can't completely remind
why this was useful.
The problem appears to be that when ImageMagick sees an image with only
gray in it, it seems to think, "PNG has a format specifically for
grayscale images - I'll use that." But it's usually a smaller file when
the image is saved as an indexed PNG, not as a grayscale PNG. So that's
what the original purpose of the `setOption( 'png:format', 'png8' )` line
was - to force ImageMagick to save it in indexed format rather than
grayscale format.
For grayscale images, I'm not sure if it makes a difference if you call
`quantizeImage()` and then call `setOption( 'png:format', 'png8' )`, or if
you skip the `quantizeImage()` call and just call `setOption(
'png:format', 'png8' )`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63448#comment:88>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list