diff options
Diffstat (limited to 'makePattern.py')
| -rwxr-xr-x | makePattern.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/makePattern.py b/makePattern.py index d9bbf54..98d298b 100755 --- a/makePattern.py +++ b/makePattern.py @@ -38,12 +38,14 @@ def hexdir(filename): #repage command convert original.png -resize 425x92 -repage 425x92+0+0 new.png class Pattern: + def __init__(self): self.nametag = "imPattern"; self.pid = str(getpid()) self.pattern_file = ""; self.original_file = ""; self.username = ""; + self.commands = []; def makeResultFilename(self): file_base, extension = path.splitext(self.original_file) @@ -58,11 +60,13 @@ class Pattern: #second step use the Canvas as a background def makeMask(self): #tile the pattern pattern on the canvas - call([BIN_COMPOSITE,"-tile", self.pattern_file, self.canvas_file, self.mask_file]) - + command = [BIN_COMPOSITE,"-tile", self.pattern_file, self.canvas_file, self.mask_file]; + call(command) + self.commands.append(command) #fuse the tiled file to create a mask #convert thebg.gif -compose Dst_In null: thefile.gif -matte -layers composite new.gif - call([BIN_CONVERT, self.mask_file, "-compose", "Dst_In", "null:", self.original_file, "-matte", "-layers", "composite", self.mask_file]) + command = [BIN_CONVERT, self.mask_file, "-compose", "Dst_In", "null:", self.original_file, "-matte", "-layers", "composite", self.mask_file] + call(command) #cleanup call(["rm", self.canvas_file]) |
