[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
Fri May 16 18:22:21 UTC 2025
#63448: Image quality significantly degrades for resized PNGs with transparency in
WordPress 6.8.1
-------------------------------------------------+-------------------------
Reporter: elvismdev | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.8.2
Component: Media | Version: 6.8
Severity: critical | Resolution:
Keywords: has-patch needs-testing needs-unit- | Focuses:
tests |
-------------------------------------------------+-------------------------
Comment (by siliconforks):
Replying to [comment:16 nosilver4u]:
> I think you're correct that there is no method in IM to detect the PNG
color type, which is why my original pull request added a method to do so:
https://github.com/WordPress/wordpress-develop/pull/6686
>
> If you use that, then you can accurately determine the color type, and
apply the quantization only if the color type is 3. The bit depth merely
serves to help determine how many colors are allowed when the color type
is 3. Do be sure to keep the PNG8 reduction for grayscale also.
>
> The `identifyImage` method may work sometimes, but is inaccurate similar
to `getImageType` (Adam & I discussed this in the above PR). The only
reliable method I was able to find was to parse the file directly, as I
had it in my pull request.
Did anyone try using `getImageProperty()`?
I tried it with `'png:IHDR.color_type'` and `'png:IHDR.color-type-orig'`
and they seemed to work...
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63448#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list