esp-arduino-libs / ESP32_JPEG

Arduino library of JPEG for the ESP32 SoCs (Not available in Arduino Library Manager for now, waiting for updates)
Apache License 2.0
13 stars 2 forks source link

Partial decoding #3

Open eloquentarduino opened 6 months ago

eloquentarduino commented 6 months ago

Is it possible to decode only a given region of the image? Let's say I take pictures at 640x480 resolution, but I only need the rectangle at coordinates from <0, 0> to <200, 200>. As far as I know, Jpeg works in 16x16 blocks, so would it be possible to only extract the portion of the image from <0, 0> to <208, 208> (208 being the nearest multiple of 16)?

Lzw655 commented 6 months ago

Hi @eloquentarduino, the libs in this repository currently don't support decoding partially. But my colleagues are working on this function which may be released next month.

bitbank2 commented 6 months ago

I'm working on this idea for my JPEGDEC library. There will be two paths - decode+crop and lossless crop of the jpeg compressed data. Both will be much faster than libjpeg or any current solution because I really optimized the "avoid unnecessary work" path. Also decode color->grayscale w/cropping will be ridiculously fast.