Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
smartcrop
✓ github.com/muesli/smartcrop
Finds the best crop for an image.
package main
import (
"fmt"
"github.com/muesli/smartcrop"
"image/jpeg"
"os"
)
func main() {
f, _ := os.Open("input.jpg")
defer f.Close()
img, _ := jpeg.Decode(f)
analyzer := smartcrop.NewAnalyzer()
topCrop, _ := analyzer.FindBestCrop(img, 200, 200)
fmt.Printf("Best crop: %+v\n", topCrop)
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.3.0latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.