Skip to content

Instantly share code, notes, and snippets.

@blackhalt
Created October 11, 2013 21:05
Show Gist options
  • Save blackhalt/6942024 to your computer and use it in GitHub Desktop.
Save blackhalt/6942024 to your computer and use it in GitHub Desktop.
Skripts automātiski samazina bildes un uzliek parakstu http://blackhalt.blogspot.com/2012/06/skripts-automatiski-samazina-bildes-un.html
#!/usr/bin/python
import os
import sys
def new_name(file):
os.path.splitext(file)
return '.'.join([os.path.splitext(file)[0],'jpg'])
files = sys.argv[1:]
garaka_mala = 1600
for file in files:
os.system('convert %s -filter Lanczos -sampling-factor 1x1 -unsharp 1.5x1+0.7+0.02 -quality 95 -resize "%s>" -auto-orient -font ~/.fonts/georgia.ttf -pointsize 28 -gravity southeast -stroke \'#0003\' -fill \'#0001\' -strokewidth 1 -annotate +10+0 \'BlackHalt\' -stroke none -fill \'#fff8\' -annotate +10+0 \'BlackHalt\' %s' % (file, garaka_mala, new_name(file)))
os.system('mogrify -strip %s' % (new_name(file)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment