np.shape) usually defined as [rows, cols, (channels)][255, 0, 0][128, 128, 128][255, 255, 255][0 0 0 0 0 0 0] 7 0What kinds of images would benefit from this compression scheme?
What's the problem here?
As usual, there is a tradeoff between time and space
A filter or convolution kernel is a small (usually) square matrix that gets convolved with the image:
Fun fact: this is the same as multiplication in frequency

There is a huge world of image processing, including techniques for segmentation, feature detection, registration... too much to cover in this course!
In addition to Pillow and the usual numpy, matplotlib, scipy libraries:
mkdir resized
for img in *.jpg; do
magick $img -resize 512x512! resized/$img
done