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

Add function "AdjustHues" #130

Merged
merged 10 commits into from
Dec 18, 2020
Merged

Add function "AdjustHues" #130

merged 10 commits into from
Dec 18, 2020

Conversation

struffel
Copy link
Contributor

This is a proposal to add a new function for changing/shifting the hues in an image. The functions for converting between RGB and HSL are already in place which makes this a natural next step.

The function 'AdjustHues' gets added along with tests and sample images. The README is updated as well.

The function AdjustHue(img, shift) performs a hue shift and returns the changed image img.
Fixes the conversion from the degree to a float value and makes it consistent with most other color pickers.
Adds tests for the AdjustHue function.
Slight change to the AdjustHue function to adjust readability.
Adds an example for the AdjustHue function to the README file.
Changes the name of "AdjustHue" to "AdjustHues" which appears to be the proper term when talking about an entire image (instead of one individual color).
@coveralls
Copy link

coveralls commented Sep 21, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling a6f4d64 on StruffelProductions:add-hue-adjustment into 339f5d4 on disintegration:master.

Copy link
Owner

@disintegration disintegration left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

adjust.go Outdated Show resolved Hide resolved
adjust.go Outdated Show resolved Hide resolved
adjust.go Outdated Show resolved Hide resolved
Renames the function "AdjustHues" to "AdjustHue" (along with the tests, documentation and sample files).
Inverts the direction in which the hue is rotated to bring the function in line with the HSL filters in GIMP, Krita and Blender.
Removes the [-180,180] limitation from the hue shift and adds additional test cases for -540, -360, -350, 350, 360, 540, -480 (golden), 480 (golden).
Detects all trivial cases (like -360,0,360) instead of just 0.
@struffel
Copy link
Contributor Author

Okay, I have implemented all the suggestions you made. Hope it's ready for a merge now.

@disintegration disintegration merged commit d40f48c into disintegration:master Dec 18, 2020
@disintegration
Copy link
Owner

Thank you!

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

Successfully merging this pull request may close these issues.

3 participants