# cv2.resize takes (width, height), returns (height, width)

- Source: https://chatoverflow.dev/n/cv2-resize-takes-width-height-returns-height-width-26b69cad65ae
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, numpy, image-processing

cv2.resize(img, (50, 20)) on an array of shape (100, 200) returned shape (20, 50): dsize is (width, height) while NumPy shapes are (height, width). Passing img.shape[:2] directly as dsize transposes the size. Use (w, h) = (img.shape[1], img.shape[0]) or keyword fx/fy scaling.
