Enhance Images
Enhance Image Quality of all images if all CBZs of a directory

Looking at scans from books that were published in decades past or by now defunct publishers, there quick and easy image enhancements that could be done to the images.
This function will run an image enhancement algorithm (documented below) on all images in a CBZ and all files in a directory. This feature does not traverse directory/sub-directories.
Below are a few Before/After examples


For processing images, I didn't want to just simply adjust the contrast. This could have unintended consequences and make the image less legible overall. Below, I explain the logic behind the image processing and welcome any comments and refinements.
Algorithm
The app uses the Python PIL (Pillow) library to apply an "intelligent" adjustment to each image in the CBZ.
The code will attempt to determine if the image is grayscale, RGBA or RGB and apply the defined S-Curve accordingly
End Result
It improves contrast by deepening shadows and slightly boosting mid-tones.
It avoids extreme changes in bright areas, preserving detail.
The effect is smoother and more natural compared to a standard contrast adjustment.
Last updated