On Sunday, March 29, 2020 at 11:30:02 AM UTC-6, Scott Pakin wrote: > > Does anyone know of a package that provides an image.Image > <https://golang.org/pkg/image/#Image> with an HSV color model > <https://golang.org/pkg/image/color/#Model>? I've found lots of > functions that convert color models but not a package that puts it all > together into an Image interface. > > If not, I'll write my own and make it available, but I figured I should > first check if someone has already done this. >
I'll take the lack of responses as a "no". I went ahead and wrote my own HSV support for Go images. The resulting hsvimage (analogous to image <https://golang.org/pkg/image/>) and hsvimage/hsvcolor (analogous to image/color <https://golang.org/pkg/image/color/>) are available from GitHub under a BSD-3 license: https://github.com/spakin/hsvimage This initial release supports only the NHSVA color model (non-alpha-premultiplied hue, saturation, and value with alpha channel at 8 bits per channel) and associated images. These implement, respectively, the color.Model interface <https://golang.org/pkg/image/color/#Model> and the image.Image interface <https://golang.org/pkg/image/#Image>. Caveat: HSV↔RGB conversions are slightly lossy due to 360° of hues being represented with the numbers 0–255. Enjoy, — Scott -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/8bcbbbb1-a8e5-4c52-82e4-d1a35b78ee90%40googlegroups.com.