def _embed_face(self):
        """Embeds referenced face image into the SVG.

        Browsers don't display referenced images in <img>.
        """
        face_url = self.face_image.get('{http://www.w3.org/1999/xlink}href')
        if face_url.startswith('data:image/'):
            return
        if not face_url.startswith('http'):
            # Relative path.
            face_url = 'https://sourcerer.io' + face_url

        response = urlopen(face_url)
        content_type = response.headers.get_content_type()
        data = response.read()
        encoded = base64.b64encode(data).decode()
        data_url = 'data:%s;base64,%s' % (content_type, encoded)
        self.face_image.set('{http://www.w3.org/1999/xlink}href', data_url)
        print('i Embedded JPEG %s' % face_url)
Embeds referenced face image into the SVG.

        Browsers don't display referenced images in <img>.
        
fame/avatar.py