imageshrink

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

README

ImageShrink

A small Go tool to crop transparent padding from an image according to content.

Install

Use go get to install this package

go get github.com/sha65536/imageshrink

Example

This example takes an image file, shrinks it, and writes to a new location.

package main

import (
	"github.com/sha65536/imageshrink"
)

func main() {
	err := imageshrink.ShrinkFile("input.png", "output.png")
	if err != nil {
		panic(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShrinkFile

func ShrinkFile(path, newpath string) error

Takes path to file, writes only the content to the new path

func ShrinkImg

func ShrinkImg(img image.Image) (image.Image, error)

Takes an image as an input, returns the a new image with only the content cropped

Types

type OpaqueImg

type OpaqueImg interface {
	Opaque() bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL