Components per color item: 3 (RGB) or 4 (RGBA). Read from the LOGICAL
shape — for encoded arrays the stored shape can differ (e.g. a LUT holds
codes), so encoding.original_shape wins when present. Anything without a
2-D shape reports 3 (the historical layout).
Components per color item: 3 (RGB) or 4 (RGBA). Read from the LOGICAL shape — for encoded arrays the stored shape can differ (e.g. a LUT holds codes), so
encoding.original_shapewins when present. Anything without a 2-D shape reports 3 (the historical layout).