imaging

package module
v0.0.0-...-89ce86e Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: MIT Imports: 4 Imported by: 1

README

imaging

Imaging is a simple image processing package for Go

GetBBox

return the bounding box as a 4-tuple defining the left, upper, right, and lower pixel coordinate.

If the image is completely empty, this method returns (0,0,0,0).

other solution,

  • GostScript
$ gs -sDevice=bbox tempCmykPdfFile.pdf|grep BoundingBox
>> return 
 %%BoundingBox: 13 48 199 100
  • Python PIL
import Image
im=Image.open("myfile.png")
print im.getbbox()

Installation

$ go get github.com/alitrack/imaging

Usage

var img image.Image
//your decode 
fmt.Println(imaging.GetBBox(img))
//if img==nil will return 0.0.0.0 

License

MIT

Author

Steven Lee(steven#alitrack.com)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Crop

func Crop(src image.Image, rect image.Rectangle) (dst image.Image, err error)

Crop crop image with given rect

func GetBBox

func GetBBox(src image.Image) (x1, y1, x2, y2 int)

GetBBox return the bounding box as a 4-tuple defining the left, upper, right, and lower pixel coordinate. If the image is completely empty, this method returns (0,0,0,0).

func MergeGrids

func MergeGrids(images []image.Image, imageCountDX, imageCountDY int) (*image.RGBA, error)

MergeGrids return merged image

Types

This section is empty.

Directories

Path Synopsis
cmd
webscreenshot
Command screenshot is a chromedp example demonstrating how to take a screenshot of a specific element and of the entire browser viewport.
Command screenshot is a chromedp example demonstrating how to take a screenshot of a specific element and of the entire browser viewport.

Jump to

Keyboard shortcuts

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