Commit Graph

9 Commits

Author SHA1 Message Date
ChaiShushan 420d421738 go.image/tiff: encoder fix non LZW Predictor and Paletted SamplesPerPixel and non RGB ExtraSamples.
TIFF6.0 Spec:
Page 31: ExtraSamples can only included in RGB mode image.
Page 39, SamplesPerPixel is usually 1 for bilevel, grayscale, and palette-color images.
Page 64, Currently Predictor field is used only with LZW.

Fixes golang/go#6421.

R=bsiegert, nigeltao, gbulmer
CC=golang-dev
https://golang.org/cl/13779043
2013-09-22 11:21:53 +10:00
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
Nigel Tao 20e9620e99 go.image/tiff: simplify encoding.
R=bsiegert
CC=golang-dev
https://golang.org/cl/5738044
2012-03-07 10:32:33 +11: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