How to construct an image from RGB channels?



Suppose I have 3 channels as arrays, I tried displaying the image below in Jupyter but it doesn’t look correct:

using Images

R = 255*rand(100,100)
G = 255*rand(100,100)
B = 255*rand(100,100)

img = colorview(RGB, R, G, B)

How to tell Images.jl that the channels have numbers like 254.3, 123.4, etc?


I’m not too familiar with Images, but probably you will need to divide your numbers by 255 to scale them into the range [0, 1].


Thank you I had an issue somewhere else in my code. The code above works well if you normalize the RGB channels, in my case I just divide each channel by 255.