One of the needs I personally ran into was the need to change the brightness, contrast and temperature of images. To solve this problem, I added the enhance object to the JSON configs options.

enhance can take one or more of five properties each one having a value from -100 to 100. A negative value causes a decrease and a positive an increase.

The enhance JSON object can have the following properties.

  • brightness Positive values cause the image to be brighter. Negative values make it darker.
  • color Positive values increase the color saturation. Negative values make it more grayscale.
  • contrast Positive values increases the use of edge of spectrum colors. Negative values increase middle of spectrum colors.
  • sharpness Positive values increase the contrast between adjoining pixels. Negative values decrease the contrast between adjoining pixels.
  • temperature Positive values increase the amount of red in the image. Negative values increase the amount of blue in the image.

Note:

Enhancements are executed in the order of the properties in the enhance object.

This gives greater control over how your image is enhanced. For instance, you can change the contrast, then the temperature, and then the color.

Using the max value (-100 or 100) is pretty extreme. Most enhancements should be under between -20 and 20. This is designed to allow minor tweaks to the images that are being crunched. It will not replace Photoshop. Sorry!

Example JSON Config

{
    "directory": "C:\\Path to images\\backgrounds",
    "output": "C:\\Path to images\\backgrounds\\crunched",
    "recursive": true,
    "versions": [
        {
            "comment": "Enhanced background images",
            "file_format": "JPEG",
            "quality": 70,
            "width": 1920,
            "height": 1080,
            "append": "-bg",
            "keep_metadata": false,
            "enhance": {
                "brightness": 10,
                "temperature": -15,
                "contrast": 10,
                "color": -10
            }
        }
    ]
}