# Save

Save the current image to a filesystem.

## Parameters

<table><thead><tr><th width="198.4826833846656">Parameter</th><th width="208.18338610093963">Type</th><th>Description</th></tr></thead><tbody><tr><td>path</td><td><code>string</code></td><td>Path to the file where to write the image data. See <a href="../../usage/overview#output-as-a-file">Output as a file</a> for supported formats.</td></tr><tr><td>quality</td><td><code>int</code></td><td>The quality of the image. Optional parameter. Only when the extension on path is <code>jpg</code> or <code>jpeg</code>, this parameter works. The valid range is (0, 100), and the default is 100.</td></tr></tbody></table>

## Return Values

The instance of `*imgo.Image` .

## Examples

### PNG

```go
package main

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

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

### JPEG

```go
package main

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

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

```go
package main

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

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

### BMP

```go
package main

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

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

### TIFF

```go
package main

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

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