示例#1
0
// Coalesce composites a set of images while respecting any page offsets and
// disposal methods. GIF, MIFF, and MNG animation sequences typically start
// with an image background and each subsequent image varies in size and
// offset. Coalesce() returns a new sequence where each image in the sequence
// is the same size as the first and composited with the next image in the
// sequence.
func (im *Image) Coalesce() (*Image, error) {
	if im.coalesced {
		return im, nil
	}
	res, err := im.fn("coalescing", C.ImageFunc(C.CoalesceImages))
	if res != nil {
		res.coalesced = true
	}
	return res, err
}
示例#2
0
文件: resize.go 项目: kitak/magick
// Minify is a convenience method that scales an image proportionally to half its size.
func (im *Image) Minify() (*Image, error) {
	return im.applyFunc("minifying", C.ImageFunc(C.MinifyImage))
}
示例#3
0
func (im *Image) Mosaic() (*Image, error) {
	return im.fn("mosaic", C.ImageFunc(C.mosaicImages))
}
示例#4
0
// Flop creates a horizontal mirror image by reflecting the pixels around
// the central y-axis.
func (im *Image) Flop() (*Image, error) {
	return im.applyFunc("flopping", C.ImageFunc(C.FlopImage))
}
示例#5
0
// Flatten merges a sequence of images. This is useful for combining Photoshop
// layers into a single image.
func (im *Image) Flatten() (*Image, error) {
	return im.fn("flattening", C.ImageFunc(C.flattenImages))
}
示例#6
0
func (im *Image) Deconstruct() (*Image, error) {
	return im.fn("deconstructing", C.ImageFunc(C.DeconstructImages))
}