forked from ideamonk/PyMos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test
executable file
·59 lines (51 loc) · 2.24 KB
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Pandamonkium Productions present
# ____ __ ___
# / __ \__ __/ |/ /___ _____
# / /_/ / / / / /|_/ / __ \/ ___/
# / ____/ /_/ / / / / /_/ (__ )
# /_/ \__, /_/ /_/\____/____/
# /____/
#
# -- ideamonk and yuvipanda
# #hackers-india
# Mosaic Generator using Python
''' pymos command line utility to generate mosaics'''
import sys, logging
try:
import argparse
except ImportError:
print "argparse required but missing"
sys.exit(1)
from pymos.core import build_mosaic
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog="pymos",
description = "Creates mosaics of a collection of images to \
closely match a target image")
parser.add_argument("input", help="Input file")
parser.add_argument("output", help="Output file")
parser.add_argument("collection",
help="Directory holding images to be mosaiced")
parser.add_argument("-z", "--zoom", default=20, type=int,
help="Zoom Level (20)")
parser.add_argument("-ts", "--thumbsize", default=60,
type=int, help="Size of the thumbnails (60)")
parser.add_argument("-f", "--fuzzfactor", default=0,
type=int, help="Amount of randomness in output (0)")
parser.add_argument("-v", "--verbose",
action="store_true", help="Show verbose output")
parser.add_argument("-nc", "--new-colormap", action="store_true",
help="Regenerate color map", default=False)
args = parser.parse_args()
logging.basicConfig()
log = logging.getLogger("PyMos")
if args.verbose:
log.setLevel(logging.DEBUG)
else:
log.setLevel(logging.INFO)
print args.fuzzfactor
build_mosaic(input_path=args.input, output_path=args.output,
collection_path=args.collection, zoom=args.zoom,
thumb_size=args.thumbsize, fuzz=args.fuzzfactor,
new_colormap=args.new_colormap)