• lolan

    Hey, nice tutorial.
    Although I keep running into an IndexError: byteArray index out of range.
    My code is just as yours is. I have even copy pasted the code directly.

    • Vinay Jain

      Hey, glad to know you liked it.

      Looks like you don’t have the Roboto-Bold.ttf font installed on your system. Can you please try again after installing the font. Here is a link to a guided tutorial for installing fonts on

      Ubuntu:- https://askubuntu.com/a/3706

      For MacOs and Windows just double-click the downloaded ttf/otf files to install.

      Please feel free to ask any related queries.

    • Thanks lolan. The IndexError exception is thrown by the ImageFont module when it cannot find the specified font file installed on the computer. Just install the font you are using to fix this error.

  • Shekhar Sam

    Nice Tutorial…But we can also go for openCV.

    • Thanks Shekhar, glad to know that you liked it. We had thought about using OpenCV for this but after some research on Image processing libraries we found out that Pillow performs better than OpenCV and ImageMagick. Please have a look at the benchmarks at the Pillow website:

      http://python-pillow.org/pillow-perf/

  • Adi Khanna

    Any particular reason , as to why you did not mention the option of picking a color out of ImageColor.colormap which contains a list of commonly used colors and more, and is inherently more simple that mentioning the rgb value by hand

    • We just wanted to keep it as flexible as possible. And using the rgb(0,0,0) syntax allows the users of this tool to skip any new color format.