resources/images: Add $image.Colors

Which returns the most dominant colors of an image using a simple histogram method.

Fixes #10307
This commit is contained in:
Bjørn Erik Pedersen 2022-09-21 16:24:54 +02:00
parent 08f0984f91
commit a4028112e3
10 changed files with 90 additions and 0 deletions

View file

@ -213,6 +213,10 @@ func (r *resourceAdapter) Exif() *exif.ExifInfo {
return r.getImageOps().Exif()
}
func (r *resourceAdapter) Colors() ([]string, error) {
return r.getImageOps().Colors()
}
func (r *resourceAdapter) Key() string {
r.init(false, false)
return r.target.(resource.Identifier).Key()