Commit Graph

8 Commits

Author SHA1 Message Date
ChaiShushan
b2d744f611 go.image/tiff: support 16bit RGB
R=nigeltao, bsiegert
CC=golang-dev
https://golang.org/cl/13736044
2013-09-18 17:16:05 +10:00
ChaiShushan
e39b2394e5 go.image/tiff: encoder support Gray/Gray16/Paletted format
Use these commands to generate testdata:

# TIFF Tools
tiff2bw    video-001.tiff video-001-gray.tiff
tiffmedian video-001.tiff video-001-paletted.tiff

# ImageMagick
convert -depth 16 video-001.tiff      video-001-16bit.tiff
convert -depth 16 video-001-gray.tiff video-001-gray-16bit.tiff

R=nigeltao, bsiegert
CC=golang-dev
https://golang.org/cl/13243047
2013-09-13 17:42:53 +10:00
Benny Siegert
d165204442 go.image/tiff: support for writing compressed images.
Only Deflate compression is supported for now.

R=nigeltao, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6866051
2012-12-12 13:24:12 +11:00
Benny Siegert
41cf08abcf tiff: support writing files with differencing predictor.
This will make more sense after implementing compression.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6567077
2012-10-03 10:11:21 +10:00
Benny Siegert
5198c64fc9 tiff: new Options parameter for Encode.
No functional change at the moment but it will allow choosing
the compression type.

This is an incompatible, user-visible change. To get the old
behavior, callers of tiff.Encode need to add ", nil" as the
last parameter.

R=nigeltao
CC=golang-dev
https://golang.org/cl/6479044
2012-08-23 20:16:03 +10:00
Benny Siegert
c35a1ecb6c go.image/tiff: use optimized routines for RGBA and NRGBA
Performance for an RGBA image:

benchmark          old ns/op    new ns/op    delta
BenchmarkEncode      1633495         7897  -99.52%

benchmark           old MB/s     new MB/s  speedup
BenchmarkEncode        37.83      7824.96  206.85x

NRGBA images are now encoded as such, the spec calls it
"unassociated alpha".

R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/6308049
2012-06-13 10:40:38 +10:00
Benny Siegert
de792da79c go.image/tiff: add a benchmark for the encoder
The idea is to see whether it is worthwhile to implement special cases.

On my Mac Book Pro:

BenchmarkEncode	    1000	   1689656 ns/op	  36.69 MB/s

R=nigeltao, minux.ma
CC=golang-dev
https://golang.org/cl/6278050
2012-06-07 09:41:24 +10:00
Benny Siegert
f594c3aad5 go.image/tiff: initial support for writing TIFF images
The basic functionality works. Features to add in future CLs:

- compression
- fast paths for image formats that can be directly expressed in TIFF,
  such as RGBA, NRGBA and maybe Gray and Paletted.

R=nigeltao
CC=golang-dev
https://golang.org/cl/5694051
2012-03-05 11:45:47 +11:00