Esempio n. 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
}
Esempio n. 2
0
// 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))
}
Esempio n. 3
0
func (im *Image) Mosaic() (*Image, error) {
	return im.fn("mosaic", C.ImageFunc(C.mosaicImages))
}
Esempio n. 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))
}
Esempio n. 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))
}
Esempio n. 6
0
func (im *Image) Deconstruct() (*Image, error) {
	return im.fn("deconstructing", C.ImageFunc(C.DeconstructImages))
}