Skip to content

Colour profile on conversion of PNG due to latest update #2213

Closed

Description

@cleshams

Bug Description

When uploading a png image, the conversion process is desaturating the image. I believe this happens when converting via GD instead of Imagick. In previous versions of the plugin, Imagick is the default conversion tool, and works well but in the lastest update GD is being forced and leaves a desaturated image.

Downgrading to 2.5.1 and repeating the process preserves the colour of the image.

Steps to reproduce

  1. Upload a png
  2. Add to a post
  3. Observe the color difference between the original and the converted image

Screenshots

Image

Additional Context

  • Plugin version 2.6.0

Activity

  1. added
    [Type] Bug
    on Oct 7, 2025
  2. moved this to Not Started/Backlog 📆 in WP Performance Ongoingon Oct 7, 2025
  3. added
    [Plugin] Modern Image Formats
    on Oct 7, 2025
  4. adamsilverstein commented on Oct 8, 2025

    @adamsilverstein
    Member

    Hi @cleshams - thanks for the bug report. Can you please attach the original PNG image you uploaded to this ticket for testing purposes?

    Also, can you clarify - are you converting these to WebP or AVIF format?

    In previous versions of the plugin, Imagick is the default conversion tool, and works well but in the lastest update GD is being forced and leaves a desaturated image.

    So you have both engines available, but the system is choosing differently since the update?

  5. adamsilverstein commented on Oct 8, 2025

    @adamsilverstein
    Member

    Looking at the changes in this release (https://github.com/WordPress/performance/releases/tag/2025-08-25) - the most likely change that could cause an issue would be #2024. @cleshams can you confirm that reverting that PR fixes the issue for you?

  6. b1ink0 commented on Oct 8, 2025

    @b1ink0
    Contributor
  7. b1ink0 commented on Oct 8, 2025

    @b1ink0
    Contributor

    I was able to replicate the bug with the screenshot provided by the reporter when I forced GD as the image editor. However, this doesn’t seem to be related to the Modern Image Format plugin even with the plugin disabled, I was able to reproduce the saturation loss. I compared the original image with the -scaled.png version generated by WordPress.

    test.mp4

    Site used to compare: https://www.textcompare.org/image/

    This is most likely an issue with the color profile. The screenshot has the LU28R55 color profile. When I changed the color profile to GIMP built-in sRGB using GIMP, there was no saturation loss.

    Converted image for testing with color profile GIMP built-in sRGB:

    Image
    demo.mp4
  8. cleshams commented on Oct 9, 2025

    @cleshams
    Author

    Hi, thanks for looking into this.
    I was coming back to update and say that it may have been a weird coincidence that made me think it was the plugin versioning, and it actually came down to two versions of the same image that was uploaded to the live and staging site where we had different plugin versions running. I've since replicated it with some jpegs from the same source, and trying it with two different image conversion plugins, as well as running it directly myself - so yeah looks like its the colour profile instead.

    So I think this can be closed, and apologies for a false error.

    Thanks

  9. adamsilverstein commented on Oct 13, 2025

    @adamsilverstein
    Member

    Thanks for the detailed analysis here @b1ink0 - closing this as "works as expected".

  10. moved this from Not Started/Backlog 📆 to Done 😃 in WP Performance Ongoingon Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Plugin] Modern Image Formats[Type] Bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions