# LoadFromImage

从 `image.Image` 实例加载图像。推荐使用 [Load](https://imgo.gitbook.io/cn/api/load) 方法加载图像。

## 参数

<table><thead><tr><th>参数名</th><th width="208.18338610093963">类型</th><th>说明</th></tr></thead><tbody><tr><td>img</td><td><code>image.Image</code></td><td>实现了 <code>image.Image</code> 接口的类型实例</td></tr></tbody></table>

## 返回值

`*imgo.Image` 类型的实例。

## 例子

```go
package main

import (
    "github.com/fishtailstudio/imgo"
    "image/png"
    "os"
)

func main() {
    file, err := os.Open("gopher.png")
    if err != nil {
        panic(err)
    }
    defer file.Close()

    img, err := png.Decode(file)
    if err != nil {
        panic(err)
    }

    imgo.LoadFromImage(img).
        Save("out.png")
}
```
