Skip to main content

Performance Optimization

1. Choose Appropriate Processing Mode

Video Mode (ProcessMode.Video)
  • Suitable for real-time video streams and live scenarios
  • Better performance, faster processing
  • Recommended for camera preview, video calls, etc.
Image Mode (ProcessMode.Image)
  • Suitable for single image processing
  • Higher quality, better effects
  • Recommended for photo editing, image beautification, etc.

2. Parameter Adjustment Recommendations

Beauty Parameter Adjustment Principles
  • Start with smaller values to avoid over-beautification
  • In real-time scenarios, recommend lowering parameter values for smoothness
  • Static images can use higher parameter values
  • Adjust parameter ranges based on user groups and scenarios
Recommended Parameter Ranges

3. Memory Optimization

Reuse Canvas and ImageData Objects
Release Resources Promptly

4. Use Web Worker (Optional)

For large amounts of image processing, consider using Web Worker to avoid blocking the main thread:

Architecture Design

1. Singleton Pattern for Engine Management

2. Parameter Management Class

3. Image Processing Pipeline

User Experience Optimization

1. Loading Status Indication

2. Progressive Loading

3. Error Retry Mechanism

Security Recommendations

1. Protect AppID and AppKey

Don’t hardcode keys in frontend code:

2. Use HTTPS

Ensure using HTTPS in production environment to protect data transmission security.

3. Validate User Input