Wednesday, April 3, 2013

blazing fast epeg photo resize on raspberry pi

I posted about speed tests and optimizations in imagemagick resize speed on raspberry pi. And I asked for suggestions for improvements or alternatives on raspberrypi stackexchange.

blazing EPEG

Krzysztof Adamski suggested I try out epeg on github, which uses libjpeg, and is touted as being "An IMMENSELY FAST JPEG thumbnailer library API".

I just did a few tests, and it does indeed seem insane-fast: I'm seeing ~1.1 second to generate a good looking 16KB image at the same 10% target size first attempt; In comparison to the fastest imagemagick option, "sample", the result is 6 times faster, is around 1/3 of the filesize (60KB) and looks about the same. The quality can be reduced further, eg to "50" using the quality parameter, which executes in the same amount of time (~1 second) but makes for a significantly smaller image (16KB) which looks similar, albeit less vibrant. Amazing results!

take a look


... with resize.jpg taking ~25.5s, scale.jpg ~5.7s and the epeg version taking just ~1.1 second (average of 3 iterations).


epeg & libjpeg setup/compile/install

There's no binary, so needed to compile. Here're the relevant steps/resources:


summary

  • epeg is Fantastic Fast :)
  • stackexchange's raspberrypi forum is great! (as is Krzysztof Adamski)

2 comments:

Anonymous said...

Thanks, your troubleshooting with Epeg helps me out.
Now I can start my own tests:)

fblu said...

Sounds promising for a raspberry pi. I found your post when looking for a way to automatically make the raspberry resize pictures from my image folders and put the smaller ones in separate folders. That's because the pi takes a while to process 10mb pictures and for a slideshow on the tv a much smaller resolution would be sufficient.

Do you know a way to schedule such a task regularly (to always have kind of an image backup... just with smaller images) and how to make epeg scan folders and save re-sized pictures to a folder with a similar name but a different location (maybe even on the pi-sd-card). Or will such a task require some heavy scripting?

Hope you have some insight, I'm somehow lost, even with google.

thanks allot for your post!