> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| opts | [InitializetionOptions](#InitializationOptions8) | Yes | Pixel properties, including the alpha type, size, scale mode, pixel format, and editable.|
| callback | AsyncCallback\<[PixelMap](#pixelmap7)> | Yes | Callback used to return the **PixelMap** object obtained.|
**Example**
```js
image.createPixelMap(Color,opts,(pixelmap)=>{
expect(pixelmap!==null).assertTrue()
done()
})
```
## PixelMap<sup>7+</sup>
Provides APIs to read or write image pixel map data and obtain image pixel map information. Before calling any API in **PixelMap**, you must use **createPixelMap** to create a **PixelMap** object.
| callback | AsyncCallback\<[ImageInfo](#imageinfo)> | Yes | Callback used to return the pixel map information. If the operation fails, an error message is returned.|
**Example**
```js
pixelmap.getImageInfo((imageInfo)=>{
if(imageInfo!==null){
console.info('TC_024-1 imageInfo is ready')
expect(imageInfo.size.height==4).assertTrue()
expect(imageInfo.size.width==6).assertTrue()
expect(imageInfo.pixelFormat==1).assertTrue()
done()
}else{
console.info('TC_024-1 imageInfo is empty')
expect(false).assertTrue()
done()
}
})
```
### getBytesNumberPerRow<sup>7+</sup>
getBytesNumberPerRow(): number
Obtains the number of bytes in each line of the image pixel map.
| [ImageSource](#imagesource) | Returns the **ImageSource** instance if the operation is successful; returns **null** otherwise.|
**Example**
```js
constimageSourceApi=image.createImageSource(0)
```
## ImageSource
Provides APIs to obtain image information. Before calling any API in **ImageSource**, you must use **createImageSource** to create an **ImageSource** instance.
| supportedFormats | Array\<string> | Yes | No | Supported image format, which can be jpeg.<br>**System capability**: SystemCapability.Multimedia.Image|