Skip to content

Crop image #284

@lars-reimann

Description

@lars-reimann

Is your feature request related to a problem?

Cropping is a common transformation on images.

Desired solution

  • Add a new method crop to Image that takes four parameters
    • x - the x coordinate of the top-left corner of the bounding rectangle
    • y - the y coordinate of the top-left corner of the bounding rectangle
    • width - the width of the bounding rectangle
    • height - the height of the bounding rectangle
  • The method should return the cropped image but leave the original unchanged

As usual in image processing, the origin of the coordinate system should be the top-left corner of the image. The x-axis should increase to the right and the y-axis should go down.

Raise an error, if the bounding rectangle is not contained in the image.

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