Helper function to compress an image.

    Returns:
      _CompressorResult named tuple, with the resulting size, the name of the
      output file and the name of the compressor.

def _process(compressor, input_filename, output_filename):
    """Helper function to compress an image.

    Returns:
      _CompressorResult named tuple, with the resulting size, the name of the
      output file and the name of the compressor.
    """
    compressor(input_filename, output_filename)
    result_size = os.path.getsize(output_filename)

    return _CompressorResult(result_size, output_filename, compressor.__name__)