# See an image in the gray scale

**URL:** <https://discourse.julialang.org/t/see-an-image-in-the-gray-scale/22264>\
**Category:** General Usage\
**Created:** [March 24, 2019, 1:28am UTC](https://discourse.julialang.org/t/see-an-image-in-the-gray-scale/22264 "2019-03-24T01:28:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GERSON\_EZEQUIEL\_HERN](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gerson_ezequiel_hern/32/7437_2.png) [@GERSON\_EZEQUIEL\_HERN](https://discourse.julialang.org/u/GERSON_EZEQUIEL_HERN)\
**Post date:** [March 24, 2019, 1:28am UTC](https://discourse.julialang.org/t/see-an-image-in-the-gray-scale/22264/1 "2019-03-24T01:28:21Z")

</div>

see an image in the gray scale.

I have a doubt. I’m working with an image but I want to know why I can not see it fast “in automatic”  
without writing

ImageView.imshow (ImageFromTestImages)  
[(This is to see a color image but I want to see the image in gray)]

this is the line of code

ImageFromTestImagesGray = Images.Gray. (ImageFromTestImages)

Could someone help me to see the image in gray?

---

<div class="post-metadata">

**Author:** ![AndiMD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andimd/32/6531_2.png) [@AndiMD](https://discourse.julialang.org/u/AndiMD)\
**Post date:** [March 24, 2019, 6:00pm UTC](https://discourse.julialang.org/t/see-an-image-in-the-gray-scale/22264/2 "2019-03-24T18:00:10Z")

</div>

I do not think the color of the image has any relevance here.

Two possibilities:

- Use Atom, it automatically displays images (Jupyter Notebook may work as well)
- Define a helper macro

```julia
using ImageView
macro imshow(img)
    return :(ImageView.imshow($img))
end
@imshow img

```

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [March 24, 2019, 6:10pm UTC](https://discourse.julialang.org/t/see-an-image-in-the-gray-scale/22264/3 "2019-03-24T18:10:49Z")

</div>

I’m not sure I understand the question, since I think you answered it yourself: `imshow(Gray.(img))`.

---

<div class="post-metadata">

**Author:** ![GERSON\_EZEQUIEL\_HERN](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gerson_ezequiel_hern/32/7437_2.png) [@GERSON\_EZEQUIEL\_HERN](https://discourse.julialang.org/u/GERSON_EZEQUIEL_HERN)\
**Post date:** [March 24, 2019, 6:53pm UTC](https://discourse.julialang.org/t/see-an-image-in-the-gray-scale/22264/4 "2019-03-24T18:53:48Z")

</div>

I’m working on this.  
import Images  
import TestImages  
import ImageMetadata  
import ImageAxes  
import ImageDraw  
import ImageView  
import ImageTransformations  
import ImageFiltering

```
ImageFromTestImages = TestImages.testimage("lighthouse")
ImageView.imshow(ImageFromTestImages)
ImageFromTestImagesGray = Images.Gray.(ImageFromTestImages)

```

But I see that many people say that when putting:

import Images  
ImageFromTestImages = TestImages.testimage (“lighthouse”)

the default image appears without putting  
imshow (img)

---

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [March 24, 2019, 7:25pm UTC](https://discourse.julialang.org/t/see-an-image-in-the-gray-scale/22264/5 "2019-03-24T19:25:43Z")

</div>

I’m not sure what you want to achieve. Please clearly describe the output you want, and the environment you’re working in (Juno? Jupyter? Terminal?). Additionally, if you’re working interactively, you can load functions more easily with `using Images, TestImages, ImageView`, since Images.jl already exports a bunch of functionality from all the other packages you’ve imported.
