# 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")
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://imgo.gitbook.io/en/api/resize.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
