Skip to content

Uploaded images lose their color profile and look washed out on a Mac #806

Open

Description

@anttikissa

Uploading an image (for example, a screenshot) on a Mac with the "Color LCD" (Display P3) color profile gives back an image without a color profile, so its colors look washed out.

For example, red rgb(255, 0, 0) (top bar) comes back as rgb(235, 50, 35), and green rgb(0, 255, 0) comes back as rgb(118, 251, 76).

Image

Served (top) and original (bottom).

Suspected reason: CreateCommitImageFiles re-encodes images with GD, which drops the ICC profile. The pixel values stay in Display P3, but browsers read them as sRGB.

Looking into a possible fix, might come with a PR later.

Activity

  1. eas4ai commented on Oct 20, 2026

    @eas4ai

    Opened a draft PR for this: #815

    It keeps the existing GD re-encode (so all other metadata is still stripped), validates the upload's ICC profile as a plausible display profile, and muxes it into the stored WebP as a VP8X ICCP chunk, for JPEG, PNG, and WebP uploads alike.

    Verified end to end on macOS: a Display P3-tagged upload comes back with sips reporting profile: Display P3 on the stored WebP, and ColorSync renders it to the same sRGB colors as the original (within 1 per channel), where the profile-dropped version renders the raw untagged values. The PR includes a browser screenshot of the three renderings side by side.

    @anttikissa you mentioned you might be looking into a fix too — happy to close mine in favor of yours if you have one in flight.

  2. anttikissa commented on Oct 20, 2026

    @anttikissa
    Author

    No PR from me for now - I tried to use libvips instead of GD, but that came with tons of caveats: it needs FFI enabled globally, and it would crash the server unless libvips was preloaded. So go ahead with yours 👍

    The work is here in case someone wants to take a look #828

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions