> For the complete documentation index, see [llms.txt](https://imgo.gitbook.io/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://imgo.gitbook.io/en/api/crop.md).

# Crop

Cut out a rectangular part of the current image.

## Parameters

<table><thead><tr><th width="198.4826833846656">Parameter</th><th width="208.18338610093963">Type</th><th>Description</th></tr></thead><tbody><tr><td>x</td><td><code>int</code></td><td>X-Coordinate of the top-left corner of the rectangular cutout.</td></tr><tr><td>y</td><td><code>int</code></td><td>Y-Coordinate of the top-left corner of the rectangular cutout.</td></tr><tr><td>width</td><td><code>int</code></td><td>Width of the rectangular cutout.</td></tr><tr><td>height</td><td><code>int</code></td><td>Height of the rectangular cutout.</td></tr></tbody></table>

## Return Values

The instance of `*imgo.Image` .

## Examples

```go
package main

import (
    "github.com/fishtailstudio/imgo"
)

func main() {
    imgo.Load("gopher.png").
        Crop(50, 50, 50, 50).
        Save("out.png")
}
```
