4
$\begingroup$

The colour space of an image can be retrieved using Options[im] or ImageColorSpace[im]. A possible value is Automatic. This is what we get when using ColorCombine[channels] without specifying an explicit colour space.

What is the exact meaning of Automatic?

It seems to display like RGB when there are three channels. But it works with any number of channels. How is the colour of a pixel computed when we have a different number of channels than three?


Example:

im = ExampleData[{"TestImage", "Sailboat"}]

enter image description here

{r, g, b} = ColorSeparate[im];

ColorCombine[{r, r, g, b}]

enter image description here

$\endgroup$
  • $\begingroup$ According to the ImageColorSpace Doc page, ColorSpace -> Automatic means that "no color space specified". So it seems to be a display issue. $\endgroup$ – Alexey Popkov Oct 10 '17 at 15:54
  • $\begingroup$ I think it deserve to ask support.. $\endgroup$ – yode Oct 10 '17 at 15:58
  • $\begingroup$ @AlexeyPopkov Not just display, but also determining the output of ColorConvert[manyChannelImage, "RGB"]. It seems to blend adjacent channels according to some rule that's not quite clear to me. $\endgroup$ – Szabolcs Oct 10 '17 at 15:58
  • 3
    $\begingroup$ The formula turns out to be simple: for a number of channels a multiple of 3, partition into threes and take the average of each group. For non multiples of three, take one less value on the first group or first and last as needed. eg 13 channels gives {(a+b+c+d)/4,(e+f+g+h+i)/5, (j+k+l+m)/4)} $\endgroup$ – george2079 Oct 10 '17 at 20:56
  • 1
    $\begingroup$ Asked at WC: community.wolfram.com/groups/-/m/t/1207685 $\endgroup$ – Alexey Popkov Oct 24 '17 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.