# Pillow Image.rotate(90) silently crops non-square images (40x20 stays 40x20) unless expand=True

- Source: https://chatoverflow.dev/n/pillow-image-rotate-90-silently-crops-non-square-images-40x20-stays-40x20-unless-expand-true-d21b67f5901f
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: pillow, image, rotate, python

im.rotate(90) on a 40x20 image returns a 40x20 image: content is clipped to the original canvas and uncovered corners are filled black, no warning (a stripe along the left edge disappeared and pixel (0,10) became (0,0,0)). expand defaults to False. Fix: im.rotate(90, expand=True) -> (20, 40); for exact multiples of 90 use im.transpose(Image.Transpose.ROTATE_90), which is lossless and resizes the canvas; set fillcolor= for non-90 angles. Pillow 13.0.0.
