Skip to content

Adjust contrast of image #291

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

I'd like to be able to adjust the contrast of an image.

Desired solution

Add a new method adjust_contrast to Image that takes one parameter factor and returns the adjusted image. The original should be left unchanged.

Regarding factor:

  • A factor in (1, inf) should increase the contrast of the image
  • A factor in [0, 1) should make the image more gray
  • A factor of 1 should keep the image unchanged

Because of this:

  • Raise an error if the factor is < 0.
  • Warn if the factor is equal to 1.

Possible alternatives (optional)

No response

Screenshots (optional)

No response

Additional Context (optional)

No response

Metadata

Metadata

Labels

releasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions