> 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/resize.md).

# Resize

Resize the image to the specified width and height.

## Parameters

<table><thead><tr><th width="198.4826833846656">Parameter</th><th width="208.18338610093963">Type</th><th>Description</th></tr></thead><tbody><tr><td>width</td><td><code>int</code></td><td>The new width of the image.</td></tr><tr><td>height</td><td><code>int</code></td><td>The new height of the image.</td></tr></tbody></table>

Width and height parameters are not allowed to be 0 at the same time, but one of them is allowed to be 0, which means that the proportion of the original image is maintained. The other parameter is calculated according to the proportion of the original image according to the non-0 parameter.

## Return Values

The instance of `*imgo.Image` .

## Examples

```go
package main

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

func main() {
    imgo.Load("gopher.png").
        Resize(100, 0).
        Save("out.png")
}
```
