bitbank2 / JPEGDEC

An optimized JPEG decoder for Arduino
Apache License 2.0
365 stars 47 forks source link

Possible more JPEG_SCALE ? #76

Closed G-Remo closed 2 months ago

G-Remo commented 2 months ago

Hello, Is it possible to have more scale option like 1/16 or 1/32

I use your library with esp32cam, it s faster to decode and resize on the fly

Thanks

bitbank2 commented 2 months ago

The scaling options exist because of the nature of JPEG compression. It's based on a 8x8 Discrete Cosine Transform and it's relatively easy to derive 1/2, 1/4 and 1/8 versions of each DCT block as you decode. To do other scales wouldn't be any different than normal pixel scaling after you decode the image.