Table of Contents

Quick project: image processing tool [python]

Morning the world! After my previous quick project article on the Filtering of corrupted gif files what I want to build here is a minimal command line utility I could use to perform simple images manipulation, like resizing, cropping, applying simple effets, etc.

I already started to build something in that direction in the article Image overview generation, but I need to make this a bit more generic: should still support gifs, and batch processing of images, but not really to create a single overview image at the end.

So let's get to work, shall we!

Preparing the initial version of the utility component

Actually that's something I might consider automating someday: the creation of simple components skeleton with a simple command ;-)

Collecting input files & configuring output

Boilerplate code to process each image file

First processing stage: applying effects

Second processing stage: reducing dimensions

resized_image.jpg

Third processing stage: gif duration multiplier

Processing stage 4: gif denoising with temporal filtering

If one day I want to reconsider this: one thing that is not so great here is that the first/last frames are not denoised with the same algorithm: because we need a window of frames before and after the frame we want to process. But one way around that could be to artificially add the sibling frames in 'reverse time' before the first frame and after the last one (ie. in the array 'arrs' in the code above)

Conclusion