Skip to content

Add preserve_tone option to autocontrast#5350

Merged
radarhere merged 16 commits intopython-pillow:masterfrom
elejke:master
Mar 29, 2021
Merged

Add preserve_tone option to autocontrast#5350
radarhere merged 16 commits intopython-pillow:masterfrom
elejke:master

Conversation

@elejke
Copy link
Copy Markdown

@elejke elejke commented Mar 21, 2021

Changes proposed in this pull request:

  • Added preserve_tone option to the autocontrast function.

As already have been discussed here autocontrast function changes the tone of the image because of the usage of separate histograms for each channel.

@broxeph, @wiredfool

Example:
example

@elejke elejke requested a review from radarhere March 22, 2021 14:25
@elejke elejke requested a review from hugovk March 23, 2021 18:21
Co-authored-by: Andrew Murray <[email protected]>
Co-authored-by: Andrew Murray <[email protected]>
@elejke elejke requested a review from radarhere March 29, 2021 09:40
@radarhere
Copy link
Copy Markdown
Member

If I remove the change to preserve tone, the tests still pass. I understand that these tests came from #1246 (comment), but they aren't going to prevent us accidentally undoing this change in the future.

I've created elejke#2 to add a test to guard against regression, by checking that preserve_tone affects RGB images, but not L images.

@elejke
Copy link
Copy Markdown
Author

elejke commented Mar 29, 2021

Good idea, thank you @radarhere

@radarhere radarhere merged commit b0b4fee into python-pillow:master Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants