go/src/image
Nigel Tao 584e3ea258 image/color: tweak the formula for converting to gray.
This makes grayModel and gray16Model in color.go use the exact same
formula as RGBToYCbCr in ycbcr.go. They were the same formula in theory,
but in practice the color.go versions used a divide by 1000 and the
ycbcr.go versions used a (presumably faster) shift by 16.

This implies the nice property that converting an image.RGBA to an
image.YCbCr and then taking only the Y channel is equivalent to
converting an image.RGBA directly to an image.Gray.

The difference between the two formulae is non-zero, but small:
https://play.golang.org/p/qG7oe-eqHI

Updates #16251

Change-Id: I288ecb957fd6eceb9626410bd1a8084d2e4f8198
Reviewed-on: https://go-review.googlesource.com/31538
Reviewed-by: Rob Pike <r@golang.org>
2016-10-20 22:27:28 +00:00
..
color image/color: tweak the formula for converting to gray. 2016-10-20 22:27:28 +00:00
draw image/draw: add FloydSteinberg Drawer example 2016-09-21 00:08:58 +00:00
gif image/gif: check handling of truncated GIF files 2016-10-05 04:28:45 +00:00
internal/imageutil image/draw: remove some bounds checks from DrawYCbCr 2016-04-17 06:25:28 +00:00
jpeg image/jpeg: reconstruct progressive images even if incomplete. 2016-03-31 00:33:24 +00:00
png image/png: improve compression by skipping filter for paletted images 2016-09-27 14:01:20 +00:00
testdata image/jpeg: reconstruct progressive images even if incomplete. 2016-03-31 00:33:24 +00:00
decode_example_test.go
decode_test.go image/jpeg: reconstruct progressive images even if incomplete. 2016-03-31 00:33:24 +00:00
format.go
geom.go
geom_test.go
image.go
image_test.go
names.go
ycbcr.go
ycbcr_test.go