ImageList Processing¶
This tutorial explains how multiple images can be handled and transformed with the ImageList
class.
Note
All operations on an ImageList
return a new ImageList
. The original ImageList
will not be changed.
Load data into an ImageList
:¶
- Load images via files in an
ImageList
:
- Create an
ImageList
from multipleImage
objects:
In [2]:
Copied!
from safeds.data.image.containers import Image
plane = Image.from_file("data/plane.png")
small_plane = Image.from_file("data/small_plane.png")
ImageList.from_images([plane, small_plane])
from safeds.data.image.containers import Image
plane = Image.from_file("data/plane.png")
small_plane = Image.from_file("data/small_plane.png")
ImageList.from_images([plane, small_plane])
Process the image¶
- Resize the images in the
ImageList
to have the width 200 and height 200:
- Convert the images in the
ImageList
to grayscale:
- Crop the images in the
ImageList
to be 200x200 with the top-left corner being at (115, 30):
- Flip the images in the
ImageList
horizontally (or vertically):
- Adjust the brightness of the images in the
ImageList
.
Giving a factor below 1 will result in darker images, a factor above 1 will return brighter images.
- Adjust the contrast of the images in the
ImageList
.
Giving a factor below 1 will decrease the contrast of the images, a factor above 1 will increase the contrast of the images.
- Adjust the color balance of the images in the
ImageList
.
A factor of 0 will return black and white images, a factor of 1 will return a copy of the original ImageList
.