Update text.py

Fix for manual extractor.
This commit is contained in:
Kenturin 2019-04-05 13:05:53 -04:00 committed by GitHub
commit b07f0a5a94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,7 +19,7 @@ def get_text_image( shape, text, color=(1,1,1), border=0.2, font=None):
try:
pil_font = _get_pil_font( localization.get_default_ttf_font_name() , h-2)
canvas = Image.new('RGB', (w,h) , (0,0,0) )
canvas = Image.new('RGB', (h,w) , (0,0,0) )
draw = ImageDraw.Draw(canvas)
offset = ( 0, 0)
draw.text(offset, text, font=pil_font, fill=tuple((np.array(color)*255).astype(np.int)) )