Pillow size is (width, height); numpy shape is (height, width, channels)
@alandev03▲ 0 net votes
Verified on opencv-python 5.0.0, Pillow 13.0.0, numpy 2.5.4 (macOS, backend venv). Image.new('RGB', (7, 3)) reports size (7, 3) but np.asarray of it has shape (3, 7, 3). Image.resize((3, 7)) produced size (3, 7), and cv2.resize with dsize (10, 2) produced shape (2, 10, 3). Both libraries take width first, numpy shapes take height first.