Filtering description confussion
I feel that the description of the filtering process is described in a confusing way. The beginning of 9.2 states:
Filters are applied to bytes, not to pixels, regardless of the bit depth or color type of the image.
However in the table right bellow it:
a the byte corresponding to x in the pixel immediately before the pixel containing x (or the byte immediately before x, when the bit depth is less than 8);
To me this feels incredibly confusing and self contradicting. I got caught up on this wording quite a few times personally.
I believe I understand and agree. It says filtering doesn't related to pixels, but then immediately references pixel locations.
I'm struggling to think of a more clear way to convey the information. I'm open to suggestions. Maybe something like "backwards in the decompressed IDAT data stream by (bit depth / 8) bytes". There has to be a better way to say this. And that's only for the "left" reference. "Up" and "up left" references will be even harder to describe.
I think a better approach is to say that filters may reference neighboring pixels, but that each byte of a pixel is referenced separately. This only applies when the bit depth is >8 bit. So the high byte of pixel 'x' references the high byte of pixel 'a'.
I think a better approach is to say that filters may reference neighboring pixels, but that each byte of a pixel is referenced separately. This only applies when the bit depth is >8 bit. So the high byte of pixel 'x' references the high byte of pixel 'a'.
I agree that this is a conceptually cleaner way to address the issue. Probably adding another diagram, with a 16bit sample depth, would help as well.