I'm experiencing something strange when using Image.resize(). I have two images, one is a cropped version of the other. I've been working out the aspect ratio so that I can resize both images by the same factor and then resizing them separately.
Now for some reason, the larger of the two images is resized fine but the cropped version has some colour distortion. It almost appears like the image has been slightly saturated.
Has anyone experienced this before or know why it might be happening?
Thanks for reading.
I haven't used Pillow, and I haven't seen your images or code, but let's say you have an image with a resolution of 400x200 and you want to resize it to 200x100, then each of the new pixels needs to have some color. Since the new image is smaller, the colors from the original will have to be mashed together to form the new colors. So, in this case where it gets smaller by a factor of two in each dimension, the color of each pixel will be the average of four pixels from the original. Similarly, if you resize to a larger image, depending on how that is done, the new pixels could be blocky (like when you zoom in to any pixel image) or smooth, which would mean that they are some interpolation of the pixels from the original image.
Using Python to resize images using Pillow, why are the colours changing?