def _writeText(self, image, text, pos):
        """Write morphed text in Image object."""
        offset = 0
        x, y = pos

        for c in text:
            # Write letter
            c_size = self.font.getsize(c)
            c_image = Image.new('RGBA', c_size, (0, 0, 0, 0))
            c_draw = ImageDraw.Draw(c_image)
            c_draw.text((0, 0), c, font=self.font, fill=(0, 0, 0, 255))

            # Transform
            c_image = self._rndLetterTransform(c_image)

            # Paste onto image
            image.paste(c_image, (x+offset, y), c_image)
            offset += c_size[0]
def _writeText ( self , image , text , pos ) : offset = 0 x , y = pos for c in text : c_size = self . font . getsize ( c ) c_image = Image . new ( 'RGBA' , c_size , ( 0 , 0 , 0 , 0 ) ) c_draw = ImageDraw . Draw ( c_image ) c_draw . text ( ( 0 , 0 ) , c , font = self . font , fill = ( 0 , 0 , 0 , 255 ) ) c_image = self . _rndLetterTransform ( c_image ) image . paste ( c_image , ( x + offset , y ) , c_image ) offset += c_size [ 0 ]
Write morphed text in Image object.