Implement Photoshop-like Curves with Leptonica

September 5, 2013

If you’ve used Leptonica, you probably know it’s a great library, but when you want to use it to replicate Photoshop like effects, you will quickly get to want more than what the library provides by default. Take the pixGammaTRC primitive as an example: If you want to modify the lightness of your image, (making it brighter or darken it), or even a simple contrast this might work good enough….

Read More >>

Enhance saturation in images programatically

August 9, 2013

Increasing the saturation in an image is equivalent to increasing the “amount of color”, while a completely desaturated image would be a grayscale image. See the images below: Normal Saturated Desaturated Grayscale Logic and Implementation Algorithm The images are composed of pixels. For a RGB24 image, each pixel is a set of 3 bytes, 1 for each of the three color channels: red, green, blue. 1 byte (or 8 bits)…

Read More >>

Leptonica saturation deficit workaround

June 28, 2013

While working with Leptonica I had the unpleasant surprise to notice that the saturation function pixModifySaturation was not really working properly (or at least not entirely as expected). First I didn’t even know what was wrong, I just felt it didn’t look right, then I saw that by transforming the saturation in Leptonica with pixModifySaturation , the contrast would be partially lost. Debugging the issue, and using different photos for…

Read More >>