2
$\begingroup$

When building a simple image with only red Rred = Image[Table[{r, 0, 0}, {r, 0, 255}, {g, 0, 255}], "Byte"], enter image description here the corresponding histogram displays badly: each channel has a wrong colour ImageHistogram[Rred, Appearance -> "Separated"] enter image description here

$\endgroup$

1 Answer 1

8
$\begingroup$

That is because you did not specify explicitly which color space you use in your image. The colors of the histograms are therefore the first three colors from the default Mathematica color scheme.

The following works as expected:

imageRed = 
 Image[Table[{r, 0, 0}, {r, 0, 255}, {g, 0, 255}], "Byte", 
  ColorSpace -> "RGB"]

ImageHistogram[imageRed, Appearance -> "Separated"]

enter image description here

$\endgroup$
1
  • $\begingroup$ You are right, I missed it. Thanks $\endgroup$
    – PaoloS
    Aug 18 at 18:22

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.