-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hugo does not read color profiles when resizing images #8298
Comments
git clone --single-branch -b hugo-github-issue-8298 https://github.com/jmooring/hugo-testing hugo-github-issue-8298
cd hugo-github-issue-8298
hugo server |
This is currently a limitation in Go's image handling -- so you currently need to apply a profile that's compatible (e.g. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While working on updating my site, I put together some test pages to make sure the content I was showing was rendering the way I expected it to. When doing so, I noticed that resized versions of images looked more muted than I expected, and so I pulled down several wide-gamut test images.
It turns out that Hugo discards the color profile when resizing images. This wouldn't be all bad if the color profile was read, and out-of-gamut colors were clipped (essentially doing a color correct conversion to sRGB), however the color profile is discarded which means that any non-sRGB image that gets resized will appear overly muted and faded when compared to the original in the same browser.
Here is an example of a test image getting resized by hugo. Because of the color shift, it means the color profile was discarded:
Here's what happens to a normal DCI-P3 image when it gets resized (Notice the fading)
I've done a little bit of digging, but I could not find any open issues on this for Hugo, nor for https://github.com/disintegration/gift which appears to be the image processing library that Hugo uses.
If you're building a site there are really only two ways to work around this right now:
However, these aren't ideal for anyone using Hugo for photography that wants to give the best possible experience for devices that support wide gamut content (Such as almost all Apple devices, and many modern cell phones). Many many templates have gallery or thumbnail views of images that would be affected by this. If it helps, I put together a set of wide-gamut test images a while ago along with a bunch of documentation if it helps reproducing this bug: https://github.com/codelogic/wide-gamut-tests
Thanks!
What version of Hugo are you using (
hugo version
)?Does this issue reproduce with the latest release?
Yes
The text was updated successfully, but these errors were encountered: