Load
Load an image。
Parameters
Parameter
Type
Description
source
interface{}
Image resource.
source parameters support the following types:
Support type
Data type
Path of the image in filesystem.
string 或 []byte
URL of an image.
string 或 []byte
Base64 encoded image data.
string 或 []byte
The instance of *os.File .
*os.File
The instance of the types that implement the image.Image interface.
image.Image and the types that implement the image.Image interface.
The instance of *imgo.Image .
*imgo.Image
Return Values
The instance of *imgo.Image .
Examples
Image Filepath
package main
import (
"github.com/fishtailstudio/imgo"
)
func main() {
imgo.Load("gopher.png").
Save("out.png")
}Image URL
Base64 encoded image data
The instance of *os.File
*os.FileThe instance of the types that implement the image.Image interface
image.Image interfaceThe instance of *imgo.Image
*imgo.ImageLast updated