summaryrefslogtreecommitdiff
path: root/helper_libs/image_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'helper_libs/image_utils.py')
-rw-r--r--helper_libs/image_utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/helper_libs/image_utils.py b/helper_libs/image_utils.py
index 70eaebb..501b6d0 100644
--- a/helper_libs/image_utils.py
+++ b/helper_libs/image_utils.py
@@ -20,12 +20,15 @@ class ImageText(object):
self.draw = ImageDraw.Draw(self.image)
self.encoding = encoding
- def line(self, shape, fill):
- self.draw.line(shape,fill=fill, width=10)
+ def line(self, shape, fill, width=10):
+ self.draw.line(shape,fill=fill, width=width)
def save(self, filename=None):
self.image.save(filename or self.filename)
+ def paste(self, image, coords):
+ self.image.paste(image, coords)
+
def get_font_size(self, text, font, max_width=None, max_height=None):
if max_width is None and max_height is None:
raise ValueError('You need to pass max_width or max_height')
@@ -122,4 +125,4 @@ class ImageText(object):
last_word_x = x + box_width - last_word_size[0]
self.write_text((last_word_x, height), words[-1], font_filename,
font_size, color)
- return (box_width, height - y) \ No newline at end of file
+ return (box_width, height - y)