Skip to content

Instantly share code, notes, and snippets.

@3lvis
Last active August 5, 2016 12:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3lvis/02d97e9b4db684d3a5f2fb323f0400f1 to your computer and use it in GitHub Desktop.
Save 3lvis/02d97e9b4db684d3a5f2fb323f0400f1 to your computer and use it in GitHub Desktop.
Script to generate 10 000 labeled images
  • brew install imagemagick
  • brew install ghostscript
  • brew install parallel
  • Then run in Terminal
seq -w 10000 | parallel --bar 'convert -gravity center -size 3000x3000 -background black -fill white -font Helvetica -pointsize 1000 label:{=$_+=0=} image{}.jpg'

Changelog:

@3lvis
Copy link
Author

3lvis commented May 25, 2016

Alternatives to improve the performance by using OpenMP

https://coderwall.com/p/s7eu7q/install-imagemagick-os-x-intel-compiler-openmp

@ole-tange
Copy link

seq 100000 | parallel 'convert -gravity center -size 3000x3000 -background black -fill white -font Helvetica -pointsize 1000 label:{} image$(printf "%06d" {}).png ; echo "done {}"'

@ole-tange
Copy link

seq -w 10000 | parallel --bar 'convert -gravity center -size 3000x3000 -background black -fill white -font Helvetica -pointsize 1000 label:{=$_+=0=} image{}.png'

@3lvis
Copy link
Author

3lvis commented May 26, 2016

Result:

image1-test1

@3lvis
Copy link
Author

3lvis commented May 26, 2016

Thanks @ole-tange added your improvements 💐

@elland
Copy link

elland commented Aug 5, 2016

Should it say brew instal parallel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment