# How to construct an image from RGB channels?

**URL:** <https://discourse.julialang.org/t/how-to-construct-an-image-from-rgb-channels/1947>\
**Category:** Visualization\
**Tags:** question, images\
**Created:** [February 7, 2017, 4:30am UTC](https://discourse.julialang.org/t/how-to-construct-an-image-from-rgb-channels/1947 "2017-02-07T04:30:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [February 7, 2017, 4:30am UTC](https://discourse.julialang.org/t/how-to-construct-an-image-from-rgb-channels/1947/1 "2017-02-07T04:30:30Z")

</div>

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

```julia
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?

---

<div class="post-metadata">

**Author:** ![fengyang.wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fengyang.wang/32/104_2.png) [@fengyang.wang](https://discourse.julialang.org/u/fengyang.wang)\
**Post date:** [February 7, 2017, 6:50am UTC](https://discourse.julialang.org/t/how-to-construct-an-image-from-rgb-channels/1947/2 "2017-02-07T06:50:04Z")

</div>

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]`.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [February 7, 2017, 4:12pm UTC](https://discourse.julialang.org/t/how-to-construct-an-image-from-rgb-channels/1947/3 "2017-02-07T16:12:49Z")

</div>

Thank you @fengyang.wang 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.
