Skip to content
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

Images get darker when resized #196

Closed
GHF opened this issue Sep 26, 2023 · 1 comment
Closed

Images get darker when resized #196

GHF opened this issue Sep 26, 2023 · 1 comment

Comments

@GHF
Copy link
Contributor

GHF commented Sep 26, 2023

I had some issues with images getting darker when downsampled, which I suspected (and mostly confirmed) was due to sharp's default pipeline being non-colorspace/gamma-aware.

Downsampling the Eric Brasseur test image from this:
gamma_2.2.jpg

to 50% produces this:
bad

when I enable sharp's linear 16-bit depth color pipeline, I get very minor changes. But when I also use the gamma() call with default parameters, I get this result, which looks much better:
good

My experience is that performing additional de-gammaing should not be needed after the colors have already been transformed from the input colorspace to linear RGB. So the fact that the gamma() call is required seems fishy because it suggests sharp's input pipeline isn't doing that colorspace conversion.

@zachleat
Copy link
Member

zachleat commented Feb 6, 2024

I think this is probably something that we’ll extend via #52 to allow folks to do custom Sharp processing pre-output.

Independently, it might be good to file this upstream on the Sharp repository. Is this related? lovell/sharp#3273

Please subscribe to #52!

@zachleat zachleat closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants