code: def exportImage(self,
                      bbox,
                      imageSR,
                      bboxSR,
                      size=[400,400],
                      time=None,
                      format="jpgpng",
                      pixelType="UNKNOWN",
                      noData=None,
                      noDataInterpretation="esriNoDataMatchAny",
                      interpolation=None,
                      compression=None,
                      compressionQuality=75,
                      bandIds=None,
                      moasiacRule=None,
                      renderingRule="",
                      f="json",
                      saveFolder=None,
                      saveFile=None
                      ):
          params = {
              "bbox" : bbox,
              "imageSR": imageSR,
              "bboxSR": bboxSR,
              "size" : "%s %s" % (size[0], size[1]),
              "pixelType" : pixelType,
              "compressionQuality" : compressionQuality,
          }
          url = self._url + "/exportImage"
          __allowedFormat = ["jpgpng", "png",
                             "png8", "png24",
                             "jpg", "bmp",
                             "gif", "tiff",
                             "png32"]
          __allowedPixelTypes = [
              "C128", "C64", "F32",
              "F64", "S16", "S32",
              "S8", "U1", "U16",
              "U2", "U32", "U4",
              "U8", "UNKNOWN"
          ]
          __allowednoDataInt = [
              "esriNoDataMatchAny",
              "esriNoDataMatchAll"
          ]
          __allowedInterpolation = [
              "RSP_BilinearInterpolation",
              "RSP_CubicConvolution",
              "RSP_Majority",
              "RSP_NearestNeighbor"
          ]
          __allowedCompression = [
              "JPEG", "LZ77"
          ]
          if isinstance(moasiacRule,MosaicRuleObject):
              params["moasiacRule"] = moasiacRule.value
          if format in __allowedFormat:
              params['format'] = format
          if isinstance(time, datetime.datetime):
              params['time'] = local_time_to_online(time)
          if interpolation is not None and \
             interpolation in __allowedInterpolation and \
             isinstance(interpolation, str):
              params['interpolation'] = interpolation
          if pixelType is not None and \
             pixelType in __allowedPixelTypes:
              params['pixelType'] = pixelType
          if noDataInterpretation in __allowedInterpolation:
              params['noDataInterpretation']  = noDataInterpretation
          if noData is not None:
              params['noData'] = noData
          if compression is not None and \
             compression in __allowedCompression:
              params['compression'] = compression
          if bandIds is not None and \
             isinstance(bandIds, list):
              params['bandIds'] = ",".join(bandIds)
          if renderingRule is not None:
              params['renderingRule'] = renderingRule
          params["f" ] = f
          if f == "json":
              return self._get(url=url,
                                  param_dict=params,
                                  securityHandler=self._securityHandler,
                                  proxy_port=self._proxy_port,
                                  proxy_url=self._proxy_url)
          elif f == "image":
              result = self._get(url=url,
                                 param_dict=params,
                                 securityHandler=self._securityHandler,
                                 proxy_url=self._proxy_url,
                                 proxy_port=self._proxy_port,
                                 out_folder=saveFolder,
                                 file_name=saveFile)
              return result
          elif f == "kmz":
              return self._get(url=url,
                               param_dict=params,
                               securityHandler=self._securityHandler,
                               proxy_url=self._proxy_url,
                               proxy_port=self._proxy_port,
                               out_folder=saveFolder,
                               file_name=saveFile)