Created
April 3, 2018 10:51
-
-
Save ilkerkesen/8b181d55aaae4772b82e5f897f5189cf to your computer and use it in GitHub Desktop.
luxor image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment