'Make an image from the QR Code data.
If the data has not been compiled yet, make it first.'

def make_image(self, image_factory=None, **kwargs):

    _check_box_size(self.box_size)
    if (self.data_cache is None):
        self.make()
    if (image_factory is not None):
        assert issubclass(image_factory, BaseImage)
    else:
        image_factory = self.image_factory
        if (image_factory is None):
            from qrcode.image.pil import PilImage
            image_factory = PilImage
    im = image_factory(self.border, self.modules_count, self.box_size, **kwargs)
    for r in range(self.modules_count):
        for c in range(self.modules_count):
            if self.modules[r][c]:
                im.drawrect(r, c)
    return im
