> For the complete documentation index, see [llms.txt](https://capellac.gitbook.io/opencv/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://capellac.gitbook.io/opencv/week1/opencv-basics/resizing-and-cropping.md).

# Resizing and Cropping

## Resize

```python
import cv2
import numpy as np

img = cv2.imread("Resources/woman.jpg")
print(img.shape)

imgResize = cv2.resize(img, (300, 300))
print(imgResize.shape)

cv2.imshow("Woman", img)
cv2.imshow("Image resized", imgResize)
cv2.waitKey(0)
```

{% hint style="info" %}

#### In OpenCV function widht comes first, then height.

{% endhint %}

## Cropping

```python
imgCropped = img[0:200, 200:500]
cv2.imshow("Image Cropped", imgCropped)
```
