Documentation ¶
Overview ¶
Package images implements functions related to image manipulation.
Index ¶
- func FileToImage(file *os.File) (img image.Image, err error)
- func FitToDimensions(img image.Image, bound, canvas image.Point) image.Image
- func ReadDimensions(img image.Image) (width, height uint)
- func SaveToJPG(img image.Image, filename string) (err error)
- func SaveToPNG(img image.Image, filename string) (err error)
- func StackVertically(first image.Image, others ...image.Image) image.Image
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileToImage ¶
FileToImage turns a os.File object into an image. This function should support opening of BMP, GIF, JPG, and PNG files.
func FitToDimensions ¶
FitToDimensions will create an image containing an original inside a canvas.X by canvas.Y image that uses the RGBA color model. The image will be resized if it exceeds bound.X x bound.Y, Having negative coordinates in bound or canvas may lead to unexpected behavior.
func ReadDimensions ¶
ReadDimensions reads the dimensions of an image.Image file and returns the width and height
func SaveToJPG ¶
SaveToJPG encodes an image to the JPG format and saves it to a file If filename already exists it will overwrite it.
func SaveToPNG ¶
SaveToPNG encodes an image to the PNG format and saves it to a file If filename already exists it will overwrite it.
func StackVertically ¶ added in v0.2.1
StackVertically stacks images on top of each other and returns the stacked version using the RGBA color model. The width of the image is that of the widest image and the height is the sum of all the images' heights. All images are arranged such that they are horizontally centered and vertically on top of each other with no space between. If some images are narrower than others, the gap will be filled with transparency.
Types ¶
This section is empty.