|
1 | 1 | --- |
2 | 2 | title: "Introducing ESP_NEW_JPEG: An Efficient JPEG Encoder and Decoder" |
3 | 3 | date: 2025-09-17 |
| 4 | +lastmod: 2025-11-06 |
4 | 5 | showAuthor: false |
5 | 6 | authors: |
6 | 7 | - lin-xu |
@@ -44,7 +45,7 @@ ESP_NEW_JPEG supports baseline profile JPEG encoding and decoding. Features such |
44 | 45 | Basic features supported by the encoder: |
45 | 46 |
|
46 | 47 | - Support encoding for any width and height |
47 | | -- Support pixel formats: RGB888, RGBA, YCbYCr, YCbY2YCrY2, and GRAY |
| 48 | +- Support pixel formats: RGB888, RGBA, RGB565(big endian), RGB565(little endian), YCbYCr, YCbY2YCrY2, CbYCrY and GRAY |
48 | 49 | - When using the YCbY2YCrY2 format, only YUV420 and Gray subsampling are supported |
49 | 50 | - Support YUV444, YUV422, YUV420, and Gray subsampling |
50 | 51 | - Support quality settings in the range of 1-100 |
@@ -264,6 +265,40 @@ void user_logic() |
264 | 265 | } |
265 | 266 | ``` |
266 | 267 |
|
| 268 | +## ESP_NEW_JPEG vs ESP_JPEG Comparison |
| 269 | + |
| 270 | +Two JPEG libraries are available for different use cases: [ESP_NEW_JPEG](https://components.espressif.com/components/espressif/esp_new_jpeg) and [ESP_JPEG](https://components.espressif.com/components/espressif/esp_jpeg). Understanding the differences between these libraries can help you choose the most suitable one for your project. |
| 271 | + |
| 272 | +ESP_NEW_JPEG is a feature-complete and performance-optimized JPEG codec library that supports both encoding and decoding, along with advanced image processing capabilities. ESP_JPEG is a lightweight decoder library based on the Tiny JPEG Decompressor (TJpgDec), focusing on minimal memory consumption and simplicity. |
| 273 | + |
| 274 | +The following table provides a detailed comparison of the two libraries: |
| 275 | + |
| 276 | +| Feature | ESP_NEW_JPEG | ESP_JPEG | |
| 277 | +|------------------|--------------------------------------------------------|-------------------------------------------------------------------------| |
| 278 | +| Encoding | ✅ Supports multiple formats | ❌ Not supported | |
| 279 | +| Decoding | ✅ Advanced features (scale, clipper, rotate) | ✅ Basic decoding with fixed scaling | |
| 280 | +| Pixel Formats | RGB888, RGBA, RGB565, YCbYCr, YCbY2YCrY2, CbYCrY, GRAY | RGB888, RGB565 | |
| 281 | +| Image Processing | ✅ Scale, clipper, rotate (0°, 90°, 180°, 270°) | ✅ Fixed scaling ratios (1/1, 1/2, 1/4, 1/8) | |
| 282 | +| Block Mode | ✅ Both encoder and decoder | ❌ Not supported | |
| 283 | +| ROM Support¹ | ❌ Not available | ✅ Available on ESP32, ESP32-S3, ESP32-C3, ESP32-C6, ESP32-C5, ESP32-C61 | |
| 284 | +| API Complexity | Handle-based, more features | Simple API | |
| 285 | +| Performance | Higher throughput | Lower memory footprint | |
| 286 | + |
| 287 | +> ¹ "[ROM Support](https://components.espressif.com/components/espressif/esp_jpeg/versions/1.3.1/readme#tjpgdec-in-rom)" indicates whether the JPEG library is built into the chip’s ROM. A ROM-based implementation helps reduce Flash usage. |
| 288 | +
|
| 289 | +When to choose ESP_NEW_JPEG: |
| 290 | + |
| 291 | +- You need JPEG encoding functionality |
| 292 | +- You need higher performance |
| 293 | +- Your application requires advanced image processing features (rotation, custom scaling, clipper) |
| 294 | +- You want to support multiple pixel formats |
| 295 | + |
| 296 | +When to choose ESP_JPEG: |
| 297 | + |
| 298 | +- You only need JPEG decoding functionality |
| 299 | +- Memory usage is a critical constraint |
| 300 | +- You're using chips with ROM support and want to save flash space |
| 301 | + |
267 | 302 | ## Conclusion |
268 | 303 |
|
269 | 304 | ESP_NEW_JPEG is a lightweight JPEG encoding and decoding library deeply optimized for the ESP32 series chips, offering efficient image compression and decompression capabilities. The library supports various features, including rotation, clipping, scaling, and block mode, enabling flexible handling of image data processing requirements in different application scenarios. We look forward to your experience with ESP_NEW_JPEG in practical applications and welcome your valuable feedback to help us continuously optimize and enhance the library's performance and features. |
0 commit comments