def _get_image_format(self, output, format=None):
    '\n        Given an output object and an optional format, attempt to determine the\n        requested image format.\n\n        This method is used by all capture methods to determine the requested\n        output format. If *format* is specified as a MIME-type the "image/"\n        prefix is stripped. If *format* is not specified, then\n        :meth:`_get_output_format` will be called to attempt to determine\n        format from the *output* object.\n        '
    if isinstance(format, bytes):
        format = format.decode('utf-8')
    format = (format or self._get_output_format(output))
    format = (format[6:] if format.startswith('image/') else format)
    if (format == 'x-ms-bmp'):
        format = 'bmp'
    if (format == 'raw'):
        format = self.raw_format
    return format
Given an output object and an optional format, attempt to determine the
requested image format.

This method is used by all capture methods to determine the requested
output format. If *format* is specified as a MIME-type the "image/"
prefix is stripped. If *format* is not specified, then
:meth:`_get_output_format` will be called to attempt to determine
format from the *output* object.
def _get_image_format(self, output, format=None):
    '\n        Given an output object and an optional format, attempt to determine the\n        requested image format.\n\n        This method is used by all capture methods to determine the requested\n        output format. If *format* is specified as a MIME-type the "image/"\n        prefix is stripped. If *format* is not specified, then\n        :meth:`_get_output_format` will be called to attempt to determine\n        format from the *output* object.\n        '
    if isinstance(format, bytes):
        format = format.decode('utf-8')
    format = (format or self._get_output_format(output))
    format = (format[6:] if format.startswith('image/') else format)
    if (format == 'x-ms-bmp'):
        format = 'bmp'
    if (format == 'raw'):
        format = self.raw_format
    return format