AI Effects
  • iOS : Objective-C
  • Android
  • Overview
  • Release notes
  • SDK downloads
  • Demo app
  • Sample codes
  • Getting started
    • Integrate the SDK
    • Import resources and models
    • Online authentication
    • Implement basic image processing
  • Guides
    • Face beautification
    • Face shape retouch
    • Beauty makeups
    • Background segmentation
    • Face detection
    • Stickers
    • Filters
  • Tutorials
  • Error codes
  • Documentation
  • AI Effects
  • Guides
  • Filters

Filters

Last updated:2022-04-19 16:17

The ZegoEffects SDK provides video filters with different styles that can be used in a wide range of use cases, such as live video streaming, short videos, and more.

Prerequisites

Before you begin to use the SDK's video filters in your project, make sure you complete the following steps:

  1. Integrate the ZegoEffects SDK into your project. For details, see Integration.
  2. Implement the basic image processing functionality. For details, see Implementation.

Implementation steps

The SDK provides video filters with the following styles:

  • Natural: Creamy, Brighten, Fresh, Autumn
  • Gray: Cool, Night, Film-like
  • Dreamy: Sunset, Cozily, Sweet

In general, you can take the following steps to use a filter:

  1. Turn on the filter by specifying the resource path of the filter.
  2. Set the filter parameters as needed. If not specified, the SDK uses the default settings.

Turn on a filter

To turn on a filter, do the following:

  1. Call the setFilter method, passing the absolute path of the corresponding filter to the path parameter.

  2. Call the setFilterParam method to set the filter intensity.

    The value range of the intensity property of ZegoEffectsFilterParam is [0, 100]. As this value gets larger, the filter effect gets more intense.

You can't superimpose the effects of different filters. Once you apply a new filter, the previous one (if any) will be overridden.

// Turn on a filter, passing in the absolute path of the corresponding filter.
[self.effects setFilter:@"/xxx/xxx/Night.bundle"];

// Set the filter intensity. The value range is [0, 100].
ZegoEffectsFilterParam *param = [[ZegoEffectsFilterParam alloc] init];
param.intensity = 100;
[self.effects setFilterParam:param];

Turn off the filter

To turn off the filter, call the setFilter method with the path parameter set to nil.

// Turn off the filter.
[self.effects setFilter:nil];
Page Directory