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

feat: added color adjustment feature #409

Merged
merged 10 commits into from
Jul 7, 2023
15 changes: 15 additions & 0 deletions src/safeds/data/image/containers/_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,21 @@ def adjust_contrast(self, factor: float) -> Image:
return image_copy

def adjust_color_balance(self, factor: float) -> Image:
patrikguempel marked this conversation as resolved.
Show resolved Hide resolved
"""
Adjust the image's color balance.

Parameters
----------
factor: float
If factor > 1, increase color balance of image.
If factor = 1, no changes will be made.
If factor < 1, make image greyer.
Has to be bigger than or equal to 0.

Returns
-------
The new, adjusted image.
Marsmaennchen221 marked this conversation as resolved.
Show resolved Hide resolved
"""
if factor < 0:
raise ValueError("Color factor has to be 0 or bigger.")
elif factor == 1:
Expand Down