# ImageView: display to true resolution

**URL:** <https://discourse.julialang.org/t/imageview-display-to-true-resolution/16646>\
**Category:** Visualization\
**Created:** [October 22, 2018, 8:36pm UTC](https://discourse.julialang.org/t/imageview-display-to-true-resolution/16646 "2018-10-22T20:36:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![harven](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@harven](https://discourse.julialang.org/u/harven)\
**Post date:** [October 22, 2018, 8:36pm UTC](https://discourse.julialang.org/t/imageview-display-to-true-resolution/16646/1 "2018-10-22T20:36:04Z")

</div>

I am using julia v1.0.1 with ImageView v0.8.  
If I use imshow(image) with an image given by a 1000x1000 array,  
the image is displayed in a 1000x1000 window. Unfortunately, the image is scaled down in order to leave a margin around the image, the bottom left of which is used to display color information for the pixel under the cursor.

How can I display the image at its true resolution (1000x1000 pixels on screen)? Is there a way to remove the margins? Or to tell it to display the image at its native resolution, and then to add the margin?

---

<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:** [October 23, 2018, 7:37am UTC](https://discourse.julialang.org/t/imageview-display-to-true-resolution/16646/2 "2018-10-23T07:37:29Z")

</div>

One option would be to resize after creation:

```julia
julia> guidct = imshow(img);

julia> sz = size(guidct["gui"]["frame"])
(1000, 981)

julia> resize!(guidct["gui"]["window"], sz[1], 2*size(img, 1) - sz[2])

julia> size(guidct["gui"]["frame"])
(1000, 1000)

```

I’d consider a PR to make that the default in ImageView.

---

<div class="post-metadata">

**Author:** ![harven](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@harven](https://discourse.julialang.org/u/harven)\
**Post date:** [October 23, 2018, 12:25pm UTC](https://discourse.julialang.org/t/imageview-display-to-true-resolution/16646/3 "2018-10-23T12:25:41Z")

</div>

Thanks for your answer.

If I compare the result displayed by ImageView with a picture obtained by saving the image and displaying it in some external viewer, the two pictures do not match exactly in size.

It seems that the size of the image displayed by `imshow` is not equal to the size `guidct["gui"]["frame"]` of the frame. The frame still includes a short border (and the size of the frame is reported equal to the size of the window after resizing), but I don’t know how to compute its width. Any hint?

Sincerely

---

<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:** [October 23, 2018, 2:27pm UTC](https://discourse.julialang.org/t/imageview-display-to-true-resolution/16646/4 "2018-10-23T14:27:19Z")

</div>

Maybe dig into the Gtk properties: [Gtk – 3.0](https://developer.gnome.org/gtk3/stable/GtkFrame.html). You may have to work your way up the hierarchy to get the info you need.
