Index: /mds-and-trees/tree-genealogy.py
===================================================================
--- /mds-and-trees/tree-genealogy.py	(revision 625)
+++ /mds-and-trees/tree-genealogy.py	(revision 626)
@@ -118,6 +118,5 @@
 
     def draw_scale(self, file, filename):
-        self.add_text(file, "Generated from " + filename.split("\\")[-1], (5, 15), "start")
-        self.add_dashed_line(file, (self.width*0.7, self.h_margin), (self.width, self.h_margin))
+        self.add_text(file, "Generated from " + filename.split("\\")[-1], (5, 5), "start")
 
         start_text = ""
@@ -133,7 +132,8 @@
            end_text = "Depth " + str(self.design.props['adepth']['max'])
 
-        self.add_text(file, start_text, (self.width, self.h_margin + 15), "end")
+        self.add_dashed_line(file, (self.width*0.7, self.h_margin), (self.width, self.h_margin))
+        self.add_text(file, start_text, (self.width, self.h_margin), "end")
         self.add_dashed_line(file, (self.width*0.7, self.height-self.h_margin), (self.width, self.height-self.h_margin))
-        self.add_text(file, end_text, (self.width, self.height-self.h_margin + 15), "end")
+        self.add_text(file, end_text, (self.width, self.height-self.h_margin), "end")
 
     def compute_property(self, part, prop, node):
@@ -168,6 +168,26 @@
 
 class PngDrawer(Drawer):
-    def draw_design(self, filename, input_filename, scale="SIMPLE"):
+
+    def scale_up(self):
+        self.width *= self.multi
+        self.height *= self.multi
+        self.w_margin *= self.multi
+        self.h_margin *= self.multi
+        self.h_no_margs *= self.multi
+        self.w_no_margs *= self.multi
+
+    def scale_down(self):
+        self.width /= self.multi
+        self.height /= self.multi
+        self.w_margin /= self.multi
+        self.h_margin /= self.multi
+        self.h_no_margs /= self.multi
+        self.w_no_margs /= self.multi
+
+    def draw_design(self, filename, input_filename, multi=1, scale="SIMPLE"):
         print("Drawing...")
+
+        self.multi=multi
+        self.scale_up()
 
         back = Image.new('RGBA', (self.width, self.height), (255,255,255,0))
@@ -183,10 +203,14 @@
             self.draw_scale(back, input_filename)
 
-        back.show()
+        #back.show()
+        self.scale_down()
+
+        back.thumbnail((self.width, self.height), Image.ANTIALIAS)
+
         back.save(filename)
 
     def add_dot(self, file, pos, style):
         x, y = int(pos[0]), int(pos[1])
-        r = style['r']
+        r = style['r']*self.multi
         offset = (int(x - r), int(y - r))
         size = (2*int(r), 2*int(r))
@@ -201,5 +225,5 @@
     def add_line(self, file, from_pos, to_pos, style):
         fx, fy, tx, ty = int(from_pos[0]), int(from_pos[1]), int(to_pos[0]), int(to_pos[1])
-        w = int(style['width'])
+        w = int(style['width'])*self.multi
 
         offset = (min(fx-w, tx-w), min(fy-w, ty-w))
@@ -210,5 +234,5 @@
         img = Image.new('RGBA', size)
         ImageDraw.Draw(img).line((w, w, size[0]-w, size[1]-w) if (fx-tx)*(fy-ty)>0 else (size[0]-w, w, w, size[1]-w),
-                                  (int(2.55*c[0]), int(2.55*c[1]), int(2.55*c[2]), int(255*style['opacity'])), int(style['width']))
+                                  (int(2.55*c[0]), int(2.55*c[1]), int(2.55*c[2]), int(255*style['opacity'])), w)
         file.paste(img, offset, mask=img)
 
@@ -225,10 +249,10 @@
 
     def add_text(self, file, text, pos, anchor, style=''):
-        font = ImageFont.truetype("Vera.ttf", 16)
+        font = ImageFont.truetype("Vera.ttf", 16*self.multi)
 
         img = Image.new('RGBA', (self.width, self.height))
         draw = ImageDraw.Draw(img)
         txtsize = draw.textsize(text, font=font)
-        pos = pos if anchor == "start" else (pos[0]-txtsize[0], pos[1]-txtsize[1])
+        pos = pos if anchor == "start" else (pos[0]-txtsize[0], pos[1])
         draw.text(pos, text, (0,0,0), font=font)
         file.paste(img, (0,0), mask=img)
@@ -245,5 +269,5 @@
 
 class SvgDrawer(Drawer):
-    def draw_design(self, filename, input_filename, scale="SIMPLE"):
+    def draw_design(self, filename, input_filename, multi=1, scale="SIMPLE"):
         print("Drawing...")
         file = open(filename, "w")
@@ -650,7 +674,7 @@
     parser.add_argument('-c', '--config', dest='config', default="", help='config file name ')
 
-    #TODO: better names for those parameters
     parser.add_argument('-W', '--width', default=600, type=int, dest='width', help='width of the output image (600 by default)')
-    parser.add_argument('-H', '--height', default=800, type=int, dest='height', help='heigt of the output image (800 by default)')
+    parser.add_argument('-H', '--height', default=800, type=int, dest='height', help='height of the output image (800 by default)')
+    parser.add_argument('-m', '--multi', default=1, type=int, dest='multi', help='multisampling factor (applicable only for raster images)')
 
     parser.add_argument('-t', '--time', default='GENERATIONAL', dest='time', help='values on vertical axis (BIRTHS/GENERATIONAL(d)/REAL); '
@@ -701,5 +725,5 @@
     else:
         drawer = PngDrawer(designer, args.config, w=args.width, h=args.height)
-    drawer.draw_design(args.output, args.input, scale=SCALE)
+    drawer.draw_design(args.output, args.input, multi=args.multi, scale=SCALE)
 
 
