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