the actual folder name your operating system usesfrom pil import imageimagedrawimagefont import os im image new('rgba'( )'white' draw imagedraw draw(imw draw text(( )'hello'fill='purple'fontsfolder 'font_foldere '/library/fontsx arialfont imagefont truetype(os path join(fontsfolder'arial ttf') draw text(( )'howdy'fill='gray'font=arialfontim save('text png'after importing imageimagedrawimagefontand oswe make an image object for new white image and make an imagedraw object from the image object we use text(to draw hello at ( in purple we didn' pass the optional fourth argument in this text(callso the typeface and size of this text aren' customized to set typeface and sizewe first store the folder name (like /library /fontsin fontsfolder then we call imagefont truetype()passing it the ttf file for the font we wantfollowed by an integer font size store the font object you get from imagefont truetype(in variable like arialfontand then pass the variable to text(in the final keyword argument the text(call at draws howdy at ( in gray in -point arial the resulting text png file will look like figure - figure - the resulting text png image summary images consist of collection of pixelsand each pixel has an rgba value for its color and its addressable by xand -coordinates two common image formats are jpeg and png the pillow module can handle both of these image formats and others manipulating images