encode(inputImage, savePath, encodeLevel)

Function Usage

Image encoding API of the ImageProcessor class. For details about the input and output formats, resolution ranges, and alignment modes, see Encode.

Input Parameter Description

Parameter

Type

Description

inputImage

Image class

Image class before encoding

savePath

str

Path for saving the encoded image. The file name extension must be jpg.

encodeLevel

int

The default value is 100. The input encoding level ranges from 0 to 100. For the Atlas inference products, it ranges from 1 to 100.

Return Parameter Description

None

Exception Throwing Interface

If the image path and the encoding level are incorrect, or the encoding fails, a runtime exception occurs.