code: def write(self, image, dest_fobj, quality=95, format=None):
          
          if isinstance(format, basestring) and format.lower() == 'jpg':
              # This mistake is made all the time. Let's just effectively alias
              # this, since it's commonly used.
              format = 'JPEG'
  
          raw_data = self._get_raw_data(image, format, quality)
          dest_fobj.write(raw_data)
docs: Wrapper for ``_write``
  
          :param Image image: This is your engine's ``Image`` object. For
              PIL it's PIL.Image.
          :keyword int quality: A quality level as a percent. The lower, the
              higher the compression, the worse the artifacts.
          :keyword str format: The format to save to. If omitted, guess based
              on the extension. We recommend specifying this. Typical values
              are 'JPEG', 'GIF', 'PNG'. Other formats largely depend on your
              choice of Engine.