How to add text on an image using pillow in Python ? Last Updated : 17 Dec, 2020 Comments Improve Suggest changes Like Article Like Report Prerequisites: PIL In this article we'll see how we can add text on an image using the pillow library in Python. Python Imaging Library (PIL) is the de facto image processing package for Python language. It incorporates lightweight image processing tools that aids in editing, creating and saving images. Pillow supports numerous image file formats including BMP, PNG, JPEG, and TIFF. Method Used Syntax: ImageDraw.Draw.text((x, y),"Text",(r,g,b))ApproachImport moduleImport imageAdd text Save image Image in use: Example 1: Python3 from PIL import Image from PIL import ImageFont from PIL import ImageDraw # importing the image img = Image.open("gfg.png") draw = ImageDraw.Draw(img) # specifying coordinates and colour of text draw.text((50, 90), "Sample Text", (255, 255, 255)) # saving the image img.save('sample.jpg') Output: Example 2: Writing text in a specific font To write the text in a specific font, we need to download the font file for the required font. In the example given below we have used Comic Sans and it can be downloaded from : https://www.wfonts.com/font/comic-sans-ms Python3 from PIL import Image from PIL import ImageFont from PIL import ImageDraw # importing the image img = Image.open("gfg.png") draw = ImageDraw.Draw(img) # loading the font and providing the size font = ImageFont.truetype("ComicSansMS3.ttf", 30) # specifying coordinates and colour of text draw.text((50, 90), "Hello World!", (255, 255, 255), font=font) # saving the image img.save('sample.jpg') Output: Comment More infoAdvertise with us Next Article How to add text on an image using pillow in Python ? P parasmadan15 Follow Improve Article Tags : Python Python-pil Practice Tags : python Similar Reads Adding Text on Image using Python - PIL In Python to open an image, image editing, saving that image in different formats one additional library called Python Imaging Library (PIL). Using this PIL we can do so many operations on images like create a new Image, edit an existing image, rotate an image, etc. For adding text we have to follow 2 min read How to Concatenate image using Pillow in Python ? Prerequisites: Python Pillow Concatenate image means joining of two images. We can merge any image whether it has different pixels, different image formats namely, 'jpeg', 'png', 'gif', 'tiff', etc. In python, we can join two images using the Python image library also known as the pillow library. In 3 min read Change image resolution using Pillow in Python Prerequisites: Python pillow PIL is the Python Imaging Library which provides the python interpreter with an in-depth file format support, an efficient internal representation, and fairly powerful image processing capabilities. Changing the resolution of an image simply means reducing or increasing 2 min read Python | Working with the Image Data Type in pillow In this article, we will look into some attributes of an Image object that will give information about the image and the file it was loaded from. For this, we will need to import image module from pillow. Image we will be working on : size() method - It helps to get the dimensions of an image. IMG = 2 min read Convert an image into jpg format using Pillow in Python Let us see how to convert an image into jpg format in Python. The size of png is larger when compared to jpg format. We also know that some applications might ask for images of smaller sizes. Hence conversion from png(larger ) to jpg(smaller) is needed. For this task we will be using the Image.conve 2 min read Like