# Image Processing

**URL:** <https://discourse.julialang.org/t/image-processing/83685>\
**Category:** Visualization\
**Tags:** question\
**Created:** [July 3, 2022, 4:35am UTC](https://discourse.julialang.org/t/image-processing/83685 "2022-07-03T04:35:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kampuny11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kampuny11/32/18985_2.png) [@Kampuny11](https://discourse.julialang.org/u/Kampuny11)\
**Post date:** [July 3, 2022, 4:35am UTC](https://discourse.julialang.org/t/image-processing/83685/1 "2022-07-03T04:35:36Z")

</div>

Hi! I having the problem to view an 3D Image. Consider the image array as:

```julia
Image[:, :, 1] = 0.0031054 0.00385944 0.00372917 0.000612832 
               0.0020886 0.000983508 0.000783196 0.000259077
               0.00157612 0.0017428 0.00129955 0.00016654   
               0.00103882 0.000802456 0.00114514 0.000242924
Image[:, :, 2] = 0.0031054 0.00385944 0.00372917 0.000612832 
               0.0020886 0.000983508 0.000783196 0.000259077
               0.00157612 0.0017428 0.00129955 0.00016654   
               0.00103882 0.000802456 0.00114514 0.000242924
Image[:, :, 3] = 0.0031054 0.00385944 0.00372917 0.000612832 
               0.0020886 0.000983508 0.000783196 0.000259077
               0.00157612 0.0017428 0.00129955 0.00016654   
               0.00103882 0.000802456 0.00114514 0.000242924

```

I need to see this image colored, combine 3 channel in one image. When i use img = RGB.(Image) function to convert and imshow(img) to see, it show the 3 channel separately. Thanks!

---

<div class="post-metadata">

**Author:** ![JohnnyChen94](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnnychen94/32/29979_2.png) [@JohnnyChen94](https://discourse.julialang.org/u/JohnnyChen94)\
**Post date:** [July 3, 2022, 6:20am UTC](https://discourse.julialang.org/t/image-processing/83685/2 "2022-07-03T06:20:37Z")

</div>

JuliaImages uses the array of struct layout `Array{RGB}` to represent an image, thus you’ll have to construct the `RGB` object manually first

```julia
colorview(RGB, permutedims(Image, (3, 1, 2)))

```

The `permutedims` is to convert the memory layout from `RRR...GGG...BBB`-like struct of array layout to `RGB...RGB`-like array of struct layout. Then you can use `colorview` function to interpret it as an `ReinterpretedArray{RGB}` stuff.

---

<div class="post-metadata">

**Author:** ![Kampuny11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kampuny11/32/18985_2.png) [@Kampuny11](https://discourse.julialang.org/u/Kampuny11)\
**Post date:** [July 3, 2022, 2:19pm UTC](https://discourse.julialang.org/t/image-processing/83685/3 "2022-07-03T14:19:23Z")

</div>

Thank you! It worked.
