Skip to content

Instantly share code, notes, and snippets.

@ilkerkesen
Created April 3, 2018 10:51
Show Gist options
  • Select an option

  • Save ilkerkesen/8b181d55aaae4772b82e5f897f5189cf to your computer and use it in GitHub Desktop.

Select an option

Save ilkerkesen/8b181d55aaae4772b82e5f897f5189cf to your computer and use it in GitHub Desktop.

Revisions

  1. ilkerkesen created this gist Apr 3, 2018.
    23 changes: 23 additions & 0 deletions frame.jl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    using Luxor

    function make_frame(W, H, images, captions, title="title", fn="drawing.png")
    @assert length(images) == length(captions)
    nimg = length(images) + 1
    width = W*nimg; height = H*nimg
    Drawing(width, height, fn)
    tiles = Tiler(W,H,1,nimg)
    origin()
    background("white")
    for (i, img, cap) in zip(1:nimg-1, images, captions)
    @layer begin
    sc = 0.01
    image = readpng(img)
    w, h = image.width, image.height
    w *= 0.2; h *= 0.2
    x, y = tiles[i][1].x, tiles[i][1].y
    placeimage(image, x, y, .5; centered=true)
    scale(sc,sc)
    end
    end
    finish()
    end