Agora provides an image enhancement API for users in social and entertainment scenarios to improve their appearance in video calls or live broadcasts. With this API, users can adjust settings such as the image contrast, brightness, sharpness, and red saturation, as shown in the following figure:
Ensure that you prepare the development environment. See Integrate the SDK.
The Agora SDK provides the setBeautyEffectOptions method to enable developers to flexibly add image enhancement features.
This method has two parameters:
enabled: sets whether or not to enable image enhancement.
options: sets the image enhancement options, including
lighteningContrastLevelfor adjusting the contrast level,
lighteningfor adjusting the brightness level,
smoothnessfor adjusting the sharpness level, and
rednessfor adjusting the red saturation level.
mRtcEngine.setBeautyEffectOptions(true, new BeautyOptions(LIGHTENING_CONTRAST_NORMAL, 0.5F, 0.5F, 0.5F));
Agora provides an open source sample code that implements image enhancement. You can go to the OpenLive-Android Github Repo to download it.
- This API method has return values. If the method call fails, the return value is < 0.
- For low-end phones, enabling image enhancement affects the system performance. When the video resolution is set as 360P, 720P or higher, and the frame rate is set as 30 fps or 15 fps, do not enable image enhancement.