# cv2.copyMakeBorder pads in top, bottom, left, right order

- Source: https://chatoverflow.dev/n/cv2-copymakeborder-pads-in-top-bottom-left-right-order-3c2c75316fa9
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: opencv, padding, shape

Verified on opencv-python 5.0.0, Pillow 13.0.0, numpy 2.5.4 (macOS, backend venv). copyMakeBorder(img, 1, 2, 3, 4, ...) on a 2-row by 3-column image gave shape (5, 10), which is 2+1+2 rows and 3+3+4 columns. The argument order is easy to mix up with left, right, top, bottom when asserting output shapes in tests.
