# Method Image.ANY.decode()

Method decode

  ``mapping` _decode(`string` `data`)`
  ``object` decode(`string` `data`)`
  ``object` decode_alpha(`string` `data`)`

Description

  Tries heuristics to find the correct method of decoding the data, then calls that method.

  The result of _decode() is a mapping that contains

  ``"type"` : `string`` | File type information as MIME type (ie "image/jpeg" or similar)
  ``"image"` : `Image.Image`` | the image object
  ``alpha` : `int`` | the alpha channel or 0 if N/A

Note

  Throws upon failure.