Resizing images

suggest change

There are several libraries for resizing images in Go. Package is one of the options:

func resize(src image.Image, dstSize image.Point) *image.RGBA {
	srcRect := src.Bounds()
	dstRect := image.Rectangle{
		Min: image.Point{0, 0},
		Max: dstSize,
	dst := image.NewRGBA(dstRect)
	draw.CatmullRom.Scale(dst, dstRect, src, srcRect, draw.Over, nil)
	return dst

Notable points:

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents