2010.06.11 21:39 "[Tiff] Class Y images with alpha channels", by Thomas Richter

2010.06.14 06:36 "Re: [Tiff] Class Y images with alpha channels", by Thomas Richter

Joris Van Damme (AWare Systems) schrieb:

is there a possibility to add an alpha channel to a class Y (YCbCr) tiff image? I don't see this in the rev.6 specs.

Nor does the spec mention 12 bit per channel YCbCr, nor does the spec mention RGB with alpha and two unspecified channels, nor does it mention 20 bit per channel grayscale, etc. We ought to understand the 'class' concept in the spec as a (misleading) enumeration of 'typical usage', whilst the tag system makes perfect sense as to allow just any variation.

Well, but then how it's done if it is not specified?

Here are two concrete questions I cannot answer from the specs:

*) Given by bits/component is not divisible by 8, how do I pack the samples? Given my understanding of the "RGB" class, I suppose I need to bit-pack the samples

as tightly as possible, that is, if I have a 9 bit YCbCr (let's assume this for a moment) with 420 subsampling, then I write 9 bits Y, 9 bits Y, 9 bits Y, 9 bits Y, 9 bits Cb, 9 bits Cr, making a total of 6*9 = 54 bits. Now, the specs furthermore say that I need to flush to the end of the byte at the end of a row. What is the end of the row here exactly? Actually, I'm writing not a single row, but two rows at once. I suppose I need to flush at the end of the "row pair" in 420?

*) Given I have an alpha channel, how is it interleaved with the remaining channels? Is the alpha channel subsampled (I suppose not, but I don't know). Is it

YYYYCbCrAAAA or is it YYYYAAAACbCr, or YYYYCbCrA?

Again, no information or examples from the specs.

So long,

Thomas