smartcrop alternatives and similar packages
Based on the "Images" category.
Alternatively, view smartcrop alternatives based on common mentions on social networks and blogs.
-
Primitive Pictures
Reproducing images with geometric primitives. -
imaginary
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing -
pigo
Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go. -
bimg
Go package for fast high-level image processing powered by libvips C library -
gowitness
🔍 gowitness - a golang, web screenshot utility using Chrome Headless -
go-opencv
Go bindings for OpenCV / 2.x API in gocv / 1.x API in opencv -
stegify
🔍 Go tool for LSB steganography, capable of hiding any file within an image. -
geopattern
:triangular_ruler: Create beautiful generative image patterns from a string in golang. -
canvas
Cairo in Go: vector to raster, SVG, PDF, EPS, WASM, OpenGL, Gio, etc. -
Angular 2 Image Gallery
Image Gallery built with Angular 15+, node.js and GraphicsMagick -
darkroom
An image proxy with changeable storage backends and image processing engines with focus on speed and resiliency. -
mergi
go library for image programming (merge, crop, resize, watermark, animate, ease, transit) -
steganography
Pure Golang Library that allows LSB steganography on images using ZERO dependencies -
fastimage
Finds the type and/or size of a remote image given its uri, by fetching as little as needed. -
webp-server
Simple and minimal image server capable of storing, resizing, converting and caching images. -
LookUp
:mag: Pure Go implementation of fast image search and simple OCR, focused on reading info from screenshots -
goimghdr
The imghdr module determines the type of image contained in a file for go -
scout
Scout is a standalone open source software solution for DIY video security.
Access the most powerful time series database as a service
Do you think we are missing an alternative of smartcrop or a related project?
Popular Comparisons
README
smartcrop
smartcrop finds good image crops for arbitrary sizes. It is a pure Go implementation, based on Jonas Wagner's smartcrop.js
[Example](./examples/gopher.jpg) Image: https://www.flickr.com/photos/usfwspacific/8182486789 by Washington Dept of Fish and Wildlife, originally licensed under CC-BY-2.0 when the image was imported back in September 2014
[Example](./examples/goodtimes.jpg) Image: https://www.flickr.com/photos/endogamia/5682480447 by Leon F. Cabeiro (N. Feans), licensed under CC-BY-2.0
Installation
Make sure you have a working Go environment (Go 1.9 or higher is required). See the install instructions.
To install smartcrop, simply run:
go get github.com/muesli/smartcrop
To compile it from source:
cd $GOPATH/src/github.com/muesli/smartcrop
go get -u -v
go build && go test -v
Example
package main
import (
"fmt"
"image"
_ "image/png"
"os"
"github.com/muesli/smartcrop"
"github.com/muesli/smartcrop/nfnt"
)
func main() {
f, _ := os.Open("image.png")
img, _, _ := image.Decode(f)
analyzer := smartcrop.NewAnalyzer(nfnt.NewDefaultResizer())
topCrop, _ := analyzer.FindBestCrop(img, 250, 250)
// The crop will have the requested aspect ratio, but you need to copy/scale it yourself
fmt.Printf("Top crop: %+v\n", topCrop)
type SubImager interface {
SubImage(r image.Rectangle) image.Image
}
croppedimg := img.(SubImager).SubImage(topCrop)
// ...
}
Also see the test cases in smartcrop_test.go and cli application in cmd/smartcrop/ for further working examples.
Simple CLI application
cd $GOPATH/src/github.com/muesli/smartcrop
go install ./cmd/smartcrop
Usage of smartcrop:
-height int
crop height
-input string
input filename
-output string
output filename
-quality int
jpeg quality (default 85)
-resize
resize after cropping (default true)
-width int
crop width
Example: smartcrop -input examples/gopher.jpg -output gopher_cropped.jpg -width 300 -height 150
Sample Data
You can find a bunch of test images for the algorithm here.
Development
Join us on IRC: irc.freenode.net/#smartcrop
*Note that all licence references and agreements mentioned in the smartcrop README section above
are relevant to that project's source code only.