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

Asked
Active
Viewed 173 times
3
PaoloS
- 31
- 2
1 Answers
8
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"]
Domen
- 23,608
- 1
- 27
- 45
-
You are right, I missed it. Thanks – PaoloS Aug 18 '22 at 18:22
