📖
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
  • PNG
  • JPEG
  • BMP
  • TIFF
  1. API

Save

Save the current image to a filesystem.

Parameters

Parameter
Type
Description

path

string

quality

int

The quality of the image. Optional parameter. Only when the extension on path is jpg or jpeg, this parameter works. The valid range is (0, 100), and the default is 100.

Return Values

The instance of *imgo.Image .

Examples

PNG

package main

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

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

JPEG

package main

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

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

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

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

BMP

package main

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

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

TIFF

package main

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

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

Last updated 2 years ago

Path to the file where to write the image data. See for supported formats.

Output as a file