📖
ImGo Documentation
  • GETTING STARTED
    • Introduction
    • Coordinate Axis
    • Supported Formats
    • Update Logs
  • Usage
    • Usage Overview
    • Errors handling
  • API
    • Blur
    • Bounds
    • Canvas
    • Circle
    • Color2Hex
    • Crop
    • Ellipse
    • Extension
    • Filesize
    • Flip
    • GaussianBlur
    • Grayscale
    • Height
    • HttpHandler
    • Insert
    • Load
    • LoadFromBase64
    • LoadFromFile
    • LoadFromImage
    • LoadFromImgo
    • LoadFromPath
    • LoadFromUrl
    • Line
    • MainColor
    • Mimetype
    • Mosaic
    • PickColor
    • Pixel
    • Pixelate
    • RadiusBorder
    • Rectangle
    • Resize
    • Rotate
    • Save
    • String
    • Text
    • Thumbnail
    • ToBase64
    • ToImage
    • Width
Powered by GitBook
On this page
  • Parameters
  • Return Values
  • Examples
  1. API

LoadFromImage

PreviousLoadFromFileNextLoadFromImgo

Last updated 2 years ago

Load an image from an instance of image.Image . It is recommended to use the method to load an image.

Parameters

Parameter
Type
Description

img

image.Image

The instance of the types that implement the image.Image interface

Return Values

The instance of *imgo.Image .

Examples

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")
}
Load