Pillow from PIL import Image, ImageFont text = words[10] font_size = 384 font_filepath = "fonts/gulim.ttc" text_color = (0, 0, 0, 255) bg_color = (255, 255, 255, 255) font = ImageFont.truetype(font_filepath, size=font_size) mask_image = font.getmask(text, "RGBA") img = Image.new("RGBA", mask_image.size, color=bg_color) img.im.paste(color, (0, 0) + mask_image.size, mask_image) img = img.convert('..