I am using the image
package to decode images and determine their format (e.g. jpg or png) however I wish to go one level deeper and I'd like to tell if the png is actually a png8
or png24
.
What would be the right way of doing this using Go?
(Update 1)
Currently I am reading able to decode the image, and I'm wondering how to grab the colour model from here:
fname := "img.jpg"
f, err := os.Open(fname)
_, format, err := image.Decode(f)
if err != nil {
log.Fatal(err)
}
fmt.Println(format, "format")
image
? – Jongware