tiled
tiled copied to clipboard
Add notion of multichannel images to array structure
This was inspired by a demo by @prjemian.
Proposal
Add a new optional key (channels?) to ArrayStructure indicated the array axis containing (color) channels such as RGB, RBG, RGBA, CMYK, etc. This is also useful in the context of multichannel imaging where the channels aren't "colors" in the traditional sense but different signals.
This could be used to by some exporters---in particular, of course, the image format exporters like PNG---to produce color images. It would give all clients more context for how to interpret the data.
The details of how to spell this remain to be worked out.
Alternatives considered
- Just leave this implicit. That leaves clients displaying color images as 3-frame stacks of monochrome images. Seems bad.
-
Leave it up to the
metadata. Image formats like TIFF and JPEG have different ways of parametrizing and spelling this. Tiled should provide a consistent view on it. -
Put it in
dims. ArrayStructure already carries adimsattribute, an (optional) list of strings mean to label each dimension of the array. Currently, the content ofdimshas no meaning to the server. If we made somedimslike"RGB"have special meaning, we would be entering new territory. For bothdimsandmetadata, I think there is value is reserving these are "user space", whose content will never change the behavior of the server.
More thoughts on why it's important to expose color channels as part of structure:
- In a sense the "topology" of a multichannel image array is different than if it's a stack of 3 images.
- Formats like JPEG apply lossy compression to the structure in a way that is fundamentally tied to the human visual system. It wouldn't make sense to expose just any
(3, N, M)array as JPEG, and the server should refuse to do it.