Crop
Cut out a rectangular part of the current image.
Parameters
Parameter
Type
Description
x
int
X-Coordinate of the top-left corner of the rectangular cutout.
y
int
Y-Coordinate of the top-left corner of the rectangular cutout.
width
int
Width of the rectangular cutout.
height
int
Height of the rectangular cutout.
Return Values
The instance of *imgo.Image
.
Examples
package main
import (
"github.com/fishtailstudio/imgo"
)
func main() {
imgo.Load("gopher.png").
Crop(50, 50, 50, 50).
Save("out.png")
}
Last updated