Documentation
¶
Index ¶
- Constants
- func AddBackgroundWhite(imgSrc image.Image) image.Image
- func Aspect(width, height int) float64
- func BestScaler() draw.Scaler
- func DefaultScaler() draw.Scaler
- func ImageAspect(img image.Image) float64
- func ImageWidthHeight(img image.Image) (int, int)
- func IsImageExt(imagePath string) bool
- func MergeHorizontalRGBA(ims ImageMetaSet) image.Image
- func OverlayCenterYLeftAlign(imgBg, imgOver image.Image) image.Image
- func ParseScalar(rawInterpolation string) (draw.Scaler, error)
- func ReadImage(filename string) (image.Image, error)
- func ReadImageDimensions(imagePath string) (int, int, error)
- func Resize(width, height uint, src image.Image, scale draw.Scaler) image.Image
- func Scale(src image.Image, rect image.Rectangle, scale draw.Scaler) image.Image
- func WriteFileJPEG(filename string, img image.Image, quality int) error
- func WriteFilePNG(filename string, img image.Image) error
- type ImageMeta
- type ImageMetaSet
- type ImageStatsMulti
Constants ¶
const DefaultQualityJPEG int = 80
Variables ¶
This section is empty.
Functions ¶
func AddBackgroundWhite ¶
AddBackgroundWhite adds a white background which is usable when the image has a transparent background.
func BestScaler ¶
func DefaultScaler ¶
DefaultScaler returns a general best results interpolation algorithm. See more here https://blog.codinghorror.com/better-image-resizing/ , https://support.esri.com/en/technical-article/000005606 , https://stackoverflow.com/questions/384991/what-is-the-best-image-downscaling-algorithm-quality-wise/6171860 .
func ImageAspect ¶
func IsImageExt ¶
func MergeHorizontalRGBA ¶
func MergeHorizontalRGBA(ims ImageMetaSet) image.Image
MergeHorizontalRGBA returns an image that is composed of non-overlapping imagers in ImageMetaSet. The code here is adapted from https://stackoverflow.com/a/35965499/1908967
func Resize ¶
Resize scales an image to the provided size units. Use a 0 to scale the aspect ratio. See gitub.com/nfnt/resize for Lanczos3, etc. https://github.com/nfnt/resize .
Types ¶
type ImageMetaSet ¶
type ImageMetaSet struct {
ImageMetas []ImageMeta
}
func NewImageSetFiles ¶
func NewImageSetFiles(filenames []string) (ImageMetaSet, error)
func (*ImageMetaSet) CloseFilesAll ¶
func (ims *ImageMetaSet) CloseFilesAll() error
func (*ImageMetaSet) MaxX ¶
func (ims *ImageMetaSet) MaxX() int
func (*ImageMetaSet) MaxY ¶
func (ims *ImageMetaSet) MaxY() int
func (*ImageMetaSet) Stats ¶
func (ims *ImageMetaSet) Stats() ImageStatsMulti
func (*ImageMetaSet) SumX ¶
func (ims *ImageMetaSet) SumX(maxIndexInclusive int) int
func (*ImageMetaSet) SumY ¶
func (ims *ImageMetaSet) SumY(maxIndexInclusive int) int