# Obtaining a Julia \`Image\` from Luxor.jl

**URL:** <https://discourse.julialang.org/t/obtaining-a-julia-image-from-luxor-jl/67992>\
**Category:** Visualization\
**Tags:** images, luxor\
**Created:** [September 10, 2021, 4:34pm UTC](https://discourse.julialang.org/t/obtaining-a-julia-image-from-luxor-jl/67992 "2021-09-10T16:34:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OvidiusCicero](https://avatars.discourse-cdn.com/v4/letter/o/73ab20/32.png) [@OvidiusCicero](https://discourse.julialang.org/u/OvidiusCicero)\
**Post date:** [September 10, 2021, 4:34pm UTC](https://discourse.julialang.org/t/obtaining-a-julia-image-from-luxor-jl/67992/1 "2021-09-10T16:34:05Z")

</div>

At the moment I draw an Image with Luxor and load it back into an Image with

```julia
using Luxor, Images, FileIO
d = Luxor.Drawing(width, height, "temp.png")
…
Luxor.finish()
load("temp.png")

```

Is there a way to get the image back an memory, either as PNG stream or even better as `Matrix{RGB{N0f8}}`?

---

<div class="post-metadata">

**Author:** ![tomerarnon](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomerarnon/32/3170_2.png) [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Post date:** [September 10, 2021, 4:46pm UTC](https://discourse.julialang.org/t/obtaining-a-julia-image-from-luxor-jl/67992/2 "2021-09-10T16:46:24Z")

</div>

Yes! Check out the `@imagematrix` macro or the `image_as_matrix` function.

---

<div class="post-metadata">

**Author:** ![OvidiusCicero](https://avatars.discourse-cdn.com/v4/letter/o/73ab20/32.png) [@OvidiusCicero](https://discourse.julialang.org/u/OvidiusCicero)\
**Post date:** [September 10, 2021, 6:49pm UTC](https://discourse.julialang.org/t/obtaining-a-julia-image-from-luxor-jl/67992/3 "2021-09-10T18:49:31Z")

</div>

thank you!
