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

# Grayscale

Convert the image to grayscale in 8-bit color.

## Parameters

None

## Return Values

The instance of `*imgo.Image` .

## Examples

```go
package main

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

func main() {
    imgo.Load("gopher.png").
        Grayscale().
        Save("out.png")
}
```

Continue editing after converting to grayscale:

```go
package main

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

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

Inserting an image converted to grayscale onto another image does not affect the color space of the other image. The following example still outputs an RGBA image.

```go
package main

import (
    "github.com/fishtailstudio/imgo"
    "golang.org/x/image/colornames"
)

func main() {
    gopher := imgo.Load("gopher.png").Grayscale()
    imgo.Canvas(300, 300, colornames.Blueviolet).
        Insert(gopher, 50, 50).
        Save("out.png")
}
```
