Skip to content

Instantly share code, notes, and snippets.

@shubhpy
Created May 23, 2018 06:18
Show Gist options
  • Save shubhpy/2f3434fabb6ba7fb8d0d93117a4a09c9 to your computer and use it in GitHub Desktop.
Save shubhpy/2f3434fabb6ba7fb8d0d93117a4a09c9 to your computer and use it in GitHub Desktop.
Create Images written 1,2,3.. on it for testing
# -*- coding: utf-8 -*-
from PIL import Image, ImageDraw,ImageFont
import boto3
import PIL.Image
def handler():
fontpath = "Roboto/Roboto-Medium.ttf"
for i in range(1,101):
im = Image.open("whiteimage.png")
draw = ImageDraw.Draw(im)
font = ImageFont.truetype(fontpath,500)
draw.text((400,400),str(i),font=font, fill=(0,0,0,0))
im.save( str(i) + ".jpg")
del draw
handler()
# pip install pillow boto3
# Download Roboto font from https://fonts.google.com/specimen/Roboto
# Download a white image from https://d2v9y0dukr6mq2.cloudfront.net/video/thumbnail/Hme4C4_7iosf3emf/vine-floral-flourish-growing-on-white-background-hd-resolution_hhcg1hcd__F0000.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment