Re-size JPG image on Arduino?

I have a project, which is working, that receives a JPG image from an ESP32CAM via LoRa.

The receiver is an Arduino DUE and the received image is saved to an SD card. The images sent are normally 800x600 or greater resolution.

With the JPEGDecoder library I have been able to display a 320x240 JPG image from the receivers SD card on an attached SPI ILI9341 TFT display.

It would be good to get a preview of the transfered image (800x600 or higher) on the receivers TFT display. I realise I could send a 320x240 image in the first place, but I prefer to be only sending higher resolution images.

Is it possible and are there any libraries, to resize say a 800x600 JPG image (or higher) into 320x240 format on an Arduino for display on the ILI9341 ?

some hints there ➜ How to scale image? · Issue #47 · Bodmer/JPEGDecoder · GitHub

There is no scaling capability built into this library. Simple methods are to skip pixels. Best is to blend NxN pixel blocks to find the average colour and plot as a single pixel.

The TJpg_Decoder library does handle scaling down by pixel skipping and has higher overall performance on 32 bit processors. Sketches are simplified too


The examples in the Tjpg_Decoder library appear to be mostly for ESP8266 or ESP32, which I was rather trying to avoid switching across to. Worth a try though.

Your 'does handle scaling down' link results in a 404 error on Github incidently.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.