# Julia merge png

**URL:** <https://discourse.julialang.org/t/julia-merge-png/12645>\
**Category:** General Usage\
**Tags:** visualization\
**Created:** [July 25, 2018, 2:13am UTC](https://discourse.julialang.org/t/julia-merge-png/12645 "2018-07-25T02:13:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Romero\_Azzalini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/romero_azzalini/32/10325_2.png) [@Romero\_Azzalini](https://discourse.julialang.org/u/Romero_Azzalini)\
**Post date:** [July 25, 2018, 2:13am UTC](https://discourse.julialang.org/t/julia-merge-png/12645/1 "2018-07-25T02:13:40Z")

</div>

Hi,  
I want to merge 3 pictures (.png) into one, like a subplot, with 2 pictures in the upper and one in the center of the bottom row. How would I do that?

Best,  
Hannes

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [July 25, 2018, 2:52am UTC](https://discourse.julialang.org/t/julia-merge-png/12645/2 "2018-07-25T02:52:51Z")

</div>

If you’re using [JuliaImages](http://juliaimages.github.io/latest/) then an image is just a `Matrix` of colors, so you can merge images using the standard Julia array tools. For example, to stack two images vertically:

```julia
julia> using TestImages

julia> im = testimage("mandrill")

julia> vcat(im, im)

```

or to stack them horizontally:

```julia
julia> hcat(im, im)

```

or to replace part of one image with another:

```julia
julia> im2 = zeros(eltype(im), 1000, 1000)

julia> im2[1:100, 1:100] .= im[1:100, 1:100]

```

---

<div class="post-metadata">

**Author:** ![Romero\_Azzalini](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/romero_azzalini/32/10325_2.png) [@Romero\_Azzalini](https://discourse.julialang.org/u/Romero_Azzalini)\
**Post date:** [July 25, 2018, 3:23pm UTC](https://discourse.julialang.org/t/julia-merge-png/12645/3 "2018-07-25T15:23:48Z")

</div>

thx, can’t wait to try it!
