def __init__(self, data=None, url=None, filename=None, format=u'<STR_LIT>', embed=None):
if filename is not None:<EOL><INDENT>ext = self._find_ext(filename)<EOL><DEDENT>elif url is not None:<EOL><INDENT>ext = self._find_ext(url)<EOL><DEDENT>elif data.startswith('<STR_LIT:http>'):<EOL><INDENT>ext = self._find_ext(data)<EOL><DEDENT>else:<EOL><INDENT>ext = None<EOL><DEDENT>if ext is not None:<EOL><INDENT>if ext == u'<STR_LIT>' or ext == u'<STR_LIT>':<EOL><INDENT>format = u'<STR_LIT>'<EOL><DEDENT>if ext == u'<STR_LIT>':<EOL><INDENT>format = u'<STR_LIT>'<EOL><DEDENT><DEDENT>self.format = unicode(format).lower()<EOL>self.embed = embed if embed is not None else (url is None)<EOL>super(Image, self).__init__(data=data, url=url, filename=filename)<EOL>
Create a display an PNG/JPEG image given raw data.

        When this object is returned by an expression or passed to the
        display function, it will result in the image being displayed
        in the frontend.

        Parameters
        ----------
        data : unicode, str or bytes
            The raw data or a URL to download the data from.
        url : unicode
            A URL to download the data from.
        filename : unicode
            Path to a local file to load the data from.
        format : unicode
            The format of the image data (png/jpeg/jpg). If a filename or URL is given
            for format will be inferred from the filename extension.
        embed : bool
            Should the image data be embedded using a data URI (True) or be
            loaded using an <img> tag. Set this to True if you want the image
            to be viewable later with no internet connection in the notebook.

            Default is `True`, unless the keyword argument `url` is set, then
            default value is `False`.

            Note that QtConsole is not able to display images if `embed` is set to `False`

        Examples
        --------
        # embed implicitly True, works in qtconsole and notebook
        Image('http://www.google.fr/images/srpr/logo3w.png')

        # embed implicitly False, does not works in qtconsole but works in notebook if
        # internet connection available
        Image(url='http://www.google.fr/images/srpr/logo3w.png')