Package magick implements image manipulation routines based on the ImageMagick MagickCore C library. It is an opinionated high level wrapper around the proven ImageMagick lib.
magick's goal is to provide quick processing of images in ways most commonly used by photo and other image based applications. It is not the intention to implement the very large number of methods that MagickCore has to offer, rather just the most common needs for basic applications. It requires ImageMagick-devel libraries to be available in order to compile.
Geometry is usually defined as a string of WxH+X+Y
A wrapper around an IM Image
NewFromBlob takes a byte slice of image data and an extension that defines the image type (e.g. "png", "jpg", etc). It loads the image data and returns a MagickImage. The extension is required so that Magick knows what processor to use.
NewFromFile loads a file at filename into a MagickImage. Exceptions are returned as MagickErrors.
Crop crops the image based on the geometry string passed and stores the cropped image in place For more info about Geometry see http://www.imagemagick.org/script/command-line-processing.php#geometry
Destroy frees the C memory for the image. Should be called after processing is done.
FillBackgroundColor fills transparent areas of an image with a solid color and stores the filled image in place. color can be any color format that image magick understands, see: http://www.imagemagick.org/ImageMagick-7.0.0/script/color.php#models
GetProperty() retreives the given attribute or freeform property string on the underlying Image
Height returns the Height of the loaded image in pixels as an int
Negate inverts the colors in the image
ParseGeometry uses ParseGeometryToRectangleInfo to convert from a geometry string into a MagickGeometry
func (im *MagickImage) ParseGeometryToRectangleInfo(geometry string) (info C.RectangleInfo, err error)
ParseGeometryToRectangleInfo converts from a geometry string (WxH+X+Y) into a Magick RectangleInfo that contains the individual properties
Progessive() is a shortcut for making the underlying image a Plane interlaced Progressive JPG
ReplaceImage Replaces the underlying image, freeing the old one
Resize resizes the image based on the geometry string passed and stores the resized image in place For more info about Geometry see http://www.imagemagick.org/script/command-line-processing.php#geometry
ResizeRatio() returns the ratio that the size you want to resize to defined by width/height is over the size of the underlying Image
SeparateAlphaChannel replaces the Image with grayscale data from the image's Alpha Channel values
SetProperty() saves the given string value either to specific known attribute or to a freeform property string on the underlying Image
func (im *MagickImage) Shadow(color string, opacity, sigma float32, xoffset, yoffset int) (err error)
Shadow adds a dropshadow to the current (transparent) image and stores the shadowed image in place For more information about shadow options see: http://www.imagemagick.org/Usage/blur/#shadow
Strip strips the image of its extra meta (exif) data
ToBlob takes a (transformed) MagickImage and returns a byte slice in the format you specify with extension. Magick uses the extension to transform the image in to the proper encoding (e.g. "jpg", "png")
ToFile writes the (transformed) MagickImage to the regular file at filename. Magick determines the encoding of the output file by the extension given to the filename (e.g. "image.jpg", "image.png")
Type returns the underlying encoding or "magick" of the image as a string
Width returns the Width of the loaded image in pixels as an int