Skip to content

Instantly share code, notes, and snippets.

@jakosz
Created February 11, 2014 12:45
Show Gist options
  • Save jakosz/8934214 to your computer and use it in GitHub Desktop.
Save jakosz/8934214 to your computer and use it in GitHub Desktop.
# Invokes imagemagick to merge png files and cleans up tmp files produced by plot_segments_mc:
compose_clean <-
function(file, mc.cores) {
t0 = Sys.time()
for (i in mc.cores:1) {
system(ps('composite mcp-tmp-', i, '.png mcp-tmp-', i - 1, '.png mcp-tmp-', i - 1, '.png'))
}
# composite execution time; catched by a testing script
.imTime <<- Sys.time() - t0
print(.imTime)
file.rename('mcp-tmp-0.png', file)
file.remove(ps('mcp-tmp-', 1:mc.cores, '.png'))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment