code: def from_json(value, **kwargs):
          
          if not value.startswith(PNG_PREAMBLE):
              raise ValueError('Not a valid base64-encoded PNG image')
          infile = BytesIO()
          rep = base64.b64decode(value[len(PNG_PREAMBLE):].encode('utf-8'))
          infile.write(rep)
          infile.seek(0)
          return infile
docs: Convert a PNG Image from base64-encoded JSON