Fix RGB conversion (there was a bug due int division istead of float)
This commit is contained in:
parent
4013228679
commit
2c3186d94f
1 changed files with 1 additions and 1 deletions
2
main.go
2
main.go
|
|
@ -44,7 +44,7 @@ func getImage(name string) (E2Image, bool) {
|
|||
}
|
||||
|
||||
func convertPixel(r uint32, g uint32, b uint32) (uint32, uint32, uint32) {
|
||||
return (r / 0xFFFF) * 255, (g / 0xFFFF) * 255, (b / 0xFFFF) * 255
|
||||
return uint32(float32(r) / 65535.0 * 255.0), uint32(float32(g) / 65535.0 * 255.0), uint32(float32(b) / 65535.0 * 255.0)
|
||||
}
|
||||
|
||||
func handleImage(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue