Skip to content

Commit 3698ba0

Browse files
authored
Merge pull request #549 from espressif/blog/announcing_esp_image_effects
Sync Merge: blog/announcing_esp_image_effects
2 parents 5422b92 + 3b16546 commit 3698ba0

File tree

1 file changed

+264
-0
lines changed
  • content/blog/2025/08/announcing_esp_image_effects

1 file changed

+264
-0
lines changed
Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
---
2+
title: ESP-Image-Effects Release | Lightweight, Powerful, and Made for a Colorful World
3+
date: 2025-08-29
4+
showAuthor: false
5+
featureAsset: "img/featured/featured-announcement.webp"
6+
authors:
7+
- hou-haiyan
8+
tags:
9+
- Multimedia
10+
- Image effects
11+
- Image scale
12+
- Image rotate
13+
- Image crop
14+
- Image color space
15+
- Image processing
16+
summary: "Espressif's ESP_IMAGE_EFFECTS component is a powerful image processing library that can do common image processing operations such as scaling, rotation, cropping, and color space conversion. This article introduces the library, shows how to use it in processing images, and provides usage examples."
17+
---
18+
19+
We are excited to announce the official release of [ESP_IMAGE_EFFECTS](https://github.com/espressif/esp-adf-libs/tree/master/esp_image_effects)) v1.0.0! ESP_IMAGE_EFFECTS is a high-performance image processing library tailored for embedded devices. It provides a unified API for various image effect modules, enabling efficient and flexible integration. With SIMD instruction set optimization and zero-copy memory design, ESP_IMAGE_EFFECTS delivers fast and lightweight image processing, making it ideal for real-time applications in smart homes, industrial vision, edge AI, and more.
20+
21+
---
22+
23+
## Overview
24+
25+
### What is ESP_IMAGE_EFFECTS?
26+
27+
ESP_IMAGE_EFFECTS (`esp_imgfx`) is a comprehensive image processing library that brings desktop-class image manipulation capabilities to embedded systems. By leveraging hardware acceleration and memory-efficient algorithms, it enables real-time image processing on resource-constrained devices without compromising performance or quality.
28+
29+
### Key Advantages
30+
31+
- **πŸš€ High Performance**: SIMD instruction set optimization for maximum throughput
32+
- **πŸ’Ύ Memory Efficient**: Zero-copy memory design minimizes RAM usage
33+
- **πŸ”§ Flexible APIs**: Modular design supports various processing pipelines
34+
- **πŸ“± Embedded Optimized**: Designed specifically for microcontroller environments
35+
- **🎯 Real-time Ready**: Millisecond-level response for time-critical applications
36+
37+
## Core Features
38+
39+
### Image Rotation
40+
41+
ESP_IMAGE_EFFECTS offers a high-performance image rotation solution that supports 1Β° precision for any angle rotation. It employs a memory block swapping algorithm for standard angles (90Β°, 180Β°, 270Β°) to achieve zero overhead processing. The use of SIMD instructions further enhances processing efficiency, making it suitable for applications like smart cameras, industrial inspection, mobile devices, and more that require real-time image rotation.
42+
43+
```c
44+
// Rotate image by any angle
45+
esp_imgfx_rotate_cfg_t cfg = {
46+
.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB888,
47+
.in_res = {.width = 1920, .height = 1080},
48+
.degree = 45 // Any angle from 0-360Β°
49+
};
50+
```
51+
52+
### Color Space Conversion
53+
54+
ESP_IMAGE_EFFECTS offers a comprehensive color space conversion solution, supporting over 100+ RGB/YUV formats, fully compatible with BT601/BT709/BT2020 and other mainstream color space standards. With SIMD hardware acceleration technology, it achieves high-speed color space conversion processing, meeting the strict requirements of professional image processing applications for format compatibility and processing efficiency.
55+
56+
```c
57+
// Convert image to RGB565 format
58+
esp_imgfx_convert_cfg_t cfg = {
59+
.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB888,
60+
.out_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB565,
61+
.in_res = {.width = 1920, .height = 1080},
62+
};
63+
```
64+
65+
### Image Scaling
66+
67+
ESP_IMAGE_EFFECTS provides a high-performance image scaling solution, supporting real-time image scaling with high quality. It supports various scaling algorithms, including down-resampleing and bilinear, and can achieve high-quality image scaling with high performance. The solution is widely used in various scenarios, such as smart cameras, industrial inspection, mobile devices, and more that require real-time image scaling.
68+
69+
```c
70+
// Scale image to 50% of original size
71+
esp_imgfx_scale_cfg_t cfg = {
72+
.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB565,
73+
.in_res = {.width = 1920, .height = 1080},
74+
.scale_res = {.width = 960, .height = 540},
75+
.filter = ESP_IMGFX_SCALE_FILTER_TYPE_DOWN_RESAMPLE,
76+
};
77+
```
78+
79+
### Image Cropping
80+
81+
ESP_IMAGE_EFFECTS provides a high-performance image cropping solution, which can extract a rectangular area from an image with high precision and high performance. The solution supports any cropping start positions and rectangular area sizes, and can achieve high-quality image cropping with high performance. The solution is widely used in various scenarios, such as smart cameras, industrial inspection, mobile devices, and more that require real-time image cropping.
82+
83+
```c
84+
// Crop image to a 960x540 region starting at (320, 180)
85+
esp_imgfx_crop_cfg_t cfg = {
86+
.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB888,
87+
.in_res = {.width = 1920, .height = 1080},
88+
.cropped_res = {.width = 960, .height = 540},
89+
.x_pos = 320,
90+
.y_pos = 180,
91+
};
92+
```
93+
94+
## API Reference
95+
96+
A unified API for various image effect modules, designed to simplify development by providing a consistent and intuitive interface. It allows developers to apply and manage multiple image effects with minimal code changes, significantly reducing the learning curve.
97+
98+
### Core Functions
99+
100+
| Function Pattern | Description | Example |
101+
|------------------|-------------|---------|
102+
| `esp_imgfx_*_open` | Create processing handle | `esp_imgfx_rotate_open(&cfg, &handle)` |
103+
| `esp_imgfx_*_get_cfg` | Get current configuration | `esp_imgfx_rotate_get_cfg(handle, &cfg)` |
104+
| `esp_imgfx_*_set_cfg` | Update configuration | `esp_imgfx_rotate_set_cfg(handle, &new_cfg)` |
105+
| `esp_imgfx_*_process` | Execute image processing | `esp_imgfx_rotate_process(handle, &in, &out)` |
106+
| `esp_imgfx_*_close` | Release handle resources | `esp_imgfx_rotate_close(handle)` |
107+
| `esp_imgfx_rotate_get_rotated_resolution` | Get rotated resolution, only for rotation | `esp_imgfx_rotate_get_rotated_resolution(handle, &res)` |
108+
109+
### Utility Functions
110+
111+
| Function | Description | Use Case |
112+
|----------|-------------|----------|
113+
| `esp_imgfx_get_bits_per_pixel` | Calculate BPP for format | Memory allocation |
114+
| `esp_imgfx_get_image_size` | Calculate image size | Buffer management |
115+
116+
## Getting Started
117+
118+
### Basic Usage Example
119+
120+
```c
121+
#include "esp_imgfx_rotate.h"
122+
123+
// Configure rotation parameters
124+
esp_imgfx_rotate_cfg_t cfg = {
125+
.in_pixel_fmt = ESP_IMGFX_PIXEL_FMT_RGB888,
126+
.in_res = {.width = 1920, .height = 1080},
127+
.degree = 90
128+
};
129+
130+
// Create handle
131+
esp_imgfx_rotate_handle_t handle;
132+
esp_imgfx_err_t ret = esp_imgfx_rotate_open(&cfg, &handle);
133+
assert(ESP_IMGFX_ERR_OK == ret);
134+
135+
// Prepare image data
136+
esp_imgfx_data_t in_image = {.data_len = 1920 * 1080 * 3};
137+
esp_imgfx_data_t out_image = {.data_len = 1920 * 1080 * 3};
138+
139+
// Allocate aligned memory for optimal performance
140+
assert(0 == posix_memalign((void **)&in_image.data, 128, in_image.data_len));
141+
assert(0 == posix_memalign((void **)&out_image.data, 128, out_image.data_len));
142+
143+
// Process image
144+
ret = esp_imgfx_rotate_process(handle, &in_image, &out_image);
145+
assert(ESP_IMGFX_ERR_OK == ret);
146+
147+
// Cleanup
148+
free(in_image.data);
149+
free(out_image.data);
150+
esp_imgfx_rotate_close(handle);
151+
```
152+
153+
## Real-World Applications
154+
155+
### Smart Access Control System
156+
157+
**Pipeline**: Camera Capture β†’ Rotation Correction β†’ Face Cropping β†’ AI Inference
158+
159+
```c
160+
// Complete preprocessing pipeline for face recognition
161+
// Step 1: Convert YUV420 to RGB565
162+
esp_imgfx_color_convert_process(cc_handle, &yuv420_image, &rgb565_image);
163+
164+
// Step 2: Correct image orientation
165+
esp_imgfx_rotate_process(rotate_handle, &rgb565_image, &rgb565_rotated);
166+
167+
// Step 3: Extract face region
168+
esp_imgfx_crop_set_cfg(crop_handle, &face_crop_cfg);
169+
esp_imgfx_crop_process(crop_handle, &rgb565_rotated, &face_roi);
170+
171+
// Step 4: Ready for AI inference
172+
173+
```
174+
175+
### Medical Image Enhancement
176+
177+
**Use Case**: Endoscope image detail enhancement for diagnostic assistance
178+
179+
```c
180+
// Enhance specific regions for medical diagnosis
181+
// Original: 640x480 β†’ ROI: 200x200 β†’ Enhanced: 800x800
182+
183+
// Step 1: Extract region of interest
184+
esp_imgfx_crop_cfg_t roi_cfg;
185+
esp_imgfx_crop_get_cfg(crop_handle, &roi_cfg);
186+
roi_cfg.cropped_res.width = 200;
187+
roi_cfg.cropped_res.height = 200;
188+
roi_cfg.x_pos = 220;
189+
roi_cfg.y_pos = 140;
190+
esp_imgfx_crop_set_cfg(crop_handle, &roi_cfg);
191+
esp_imgfx_crop_process(crop_handle, &endoscope_image, &roi_image);
192+
193+
// Step 2: Enhance detail with 4x scaling
194+
esp_imgfx_scale_cfg_t scale_cfg;
195+
esp_imgfx_scale_get_cfg(scale_handle, &scale_cfg);
196+
scale_cfg.scale_res.width = 800;
197+
scale_cfg.scale_res.height = 800;
198+
esp_imgfx_scale_set_cfg(scale_handle, &scale_cfg);
199+
esp_imgfx_scale_process(scale_handle, &roi_image, &enhanced_image);
200+
```
201+
202+
### Multi-Display Adaptation
203+
204+
**Challenge**: Support various embedded display sizes (0.96" OLED to 7" industrial screens)
205+
206+
```c
207+
// Dynamic scaling for different display targets
208+
typedef struct {
209+
int width, height;
210+
const char* name;
211+
} display_config_t;
212+
213+
display_config_t displays[] = {
214+
{128, 64, "0.96\" OLED"},
215+
{320, 240, "2.4\" TFT"},
216+
{800, 480, "7\" Industrial"}
217+
};
218+
219+
// Adaptive scaling function
220+
void adapt_to_display(esp_imgfx_data_t* src, int display_index) {
221+
esp_imgfx_scale_cfg_t scale_cfg;
222+
esp_imgfx_scale_get_cfg(scale_handle, &scale_cfg);
223+
scale_cfg.scale_res.width = displays[display_index].width;
224+
scale_cfg.scale_res.height = displays[display_index].height;
225+
esp_imgfx_scale_set_cfg(scale_handle, &scale_cfg);
226+
esp_imgfx_scale_process(scale_handle, src, &display_buffer);
227+
}
228+
```
229+
230+
## Performance Benchmarks
231+
232+
refer to the [performance benchmarks](https://github.com/espressif/esp-adf-libs/blob/master/esp_image_effects/doc/PERFORMANCE_ESP32P4.md) for detailed results on processing times and resource usage.
233+
234+
## Resources and Support
235+
236+
### πŸ“š Development Resources
237+
238+
- **πŸ“– Documentation**: [Complete API Reference](https://github.com/espressif/esp-adf-libs/blob/master/esp_image_effects/)
239+
- **πŸ’» Sample Projects**: In the [ESP_IMAGE_EFFECTS Component](https://components.espressif.com/components/espressif/esp_image_effects/) repo, see the files `esp_image_effects/test_apps/main/*.c`
240+
- **πŸ“¦ Component Registry**: [ESP_IMAGE_EFFECTS Component](https://components.espressif.com/components/espressif/esp_image_effects/)
241+
- **πŸ“‹ Release Notes**: [Version History & Updates](https://github.com/espressif/esp-adf-libs/blob/master/esp_image_effects/CHANGELOG.md)
242+
243+
### πŸ› οΈ Technical Support
244+
245+
- **πŸ’¬ Community Forum**: [ESP32 Developer Community](https://esp32.com/)
246+
- **πŸ› Issue Tracker**: [GitHub Issues](https://github.com/espressif/esp-adf/issues)
247+
248+
### πŸš€ Getting Started
249+
250+
1. **Install Component**: `idf.py add-dependency "espressif/esp_image_effects"`
251+
2. **Run Examples**: Check `test_apps/` directory for working examples
252+
3. **Join Community**: Share your projects and get help from developers worldwide
253+
254+
## Conclusion
255+
256+
**Designed for intelligent vision, making every frame efficient!**
257+
258+
ESP_IMAGE_EFFECTS v1.0.0 represents a significant milestone in embedded image processing. By combining high performance with ease of use, we're empowering developers to create sophisticated vision applications on resource-constrained devices.
259+
260+
Whether you're building smart security systems, medical devices, industrial automation, or consumer electronics, ESP_IMAGE_EFFECTS provides the tools you need to process images efficiently and effectively.
261+
262+
**Ready to transform your vision applications?**
263+
264+
ESP_IMAGE_EFFECTS looks forward to exploring the infinite possibilities of image processing with developers worldwide. Join us in shaping the future of embedded computer vision!

0 commit comments

Comments
Β (0)