0
0
NumPydata~5 mins

Basic image manipulation with arrays in NumPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the role of a NumPy array in basic image manipulation?
A NumPy array stores image data as numbers, usually representing colors or brightness. This lets us change images by changing numbers in the array.
Click to reveal answer
beginner
How can you flip an image horizontally using NumPy?
You can flip an image horizontally by reversing the columns of the array using slicing like image[:, ::-1].
Click to reveal answer
beginner
What does changing the values in a NumPy image array do to the image?
Changing values changes the colors or brightness of pixels, which changes how the image looks.
Click to reveal answer
beginner
How do you crop an image using NumPy arrays?
Cropping means selecting a smaller part of the array using slicing, like image[50:150, 30:130] to get a rectangle.
Click to reveal answer
beginner
Why is it useful to convert images to arrays for manipulation?
Arrays let us use math and programming to change images easily and quickly, like adjusting brightness or flipping.
Click to reveal answer
Which NumPy slicing operation flips an image vertically?
Aimage[::-1, :]
Bimage[:, ::-1]
Cimage[::2, ::2]
Dimage[:, :]
How do you select a 100x100 pixel crop from the top-left corner of an image array?
Aimage[0:100, ::-1]
Bimage[100:200, 100:200]
Cimage[0:100, 0:100]
Dimage[:, 0:100]
What happens if you add 50 to all values in an image array?
AThe image flips horizontally
BThe image becomes brighter
CThe image becomes darker
DThe image size doubles
Which NumPy operation would invert the colors of a grayscale image with values 0-255?
A255 - image
Bimage + 255
Cimage * 2
Dimage[::-1, ::-1]
What does image[:, ::-1] do to an image array?
ARotates the image 90 degrees
BFlips the image vertically
CCrops the image
DFlips the image horizontally
Explain how you can flip, crop, and brighten an image using NumPy arrays.
Think about how slicing changes the array shape and how adding changes pixel values.
You got /3 concepts.
    Describe why images are represented as arrays and how this helps in image manipulation.
    Consider how computers see images as numbers.
    You got /3 concepts.