# LoadFromFile

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

## 参数

<table><thead><tr><th width="198.4826833846656">参数名</th><th width="208.18338610093963">类型</th><th>说明</th></tr></thead><tbody><tr><td>file</td><td><code>*os.File</code></td><td><code>*os.File</code> 类型的文件实例</td></tr></tbody></table>

## 返回值

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

## 例子

```go
package main

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

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

    imgo.LoadFromFile(file).
        Save("out.png")
}
```
