<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def writetitle(self, titlestring, colour = None):
 """ We write a title, centered below the image. """

        
        self.checkforpilimage()
        colour = self.defaultcolour(colour)
        self.changecolourmode(colour)
        self.makedraw()
        
        self.loadtitlefont()
        
        imgwidth = self.pilimage.size[0]
        imgheight = self.pilimage.size[1]
        textwidth = self.draw.textsize(titlestring, font = self.titlefont)[0]
        textxpos = imgwidth/2.0 - textwidth/2.0
        textypos = imgheight - 30
        
        self.draw.text((textxpos, textypos), titlestring, fill = colour, font = self.titlefont)
        
        if self.verbose :
            print "I've written a title on the image."