Digital photography systems often render an image from a scene-referred description with very wide dynamic range to an output-referred description of much lesser dynamic range. Global tone maps are often used for this purpose, but can fail when called on to perform a large amount of range compression. A modified luminance formulation of the Retinex ratio-reset-product-average algorithm produces a smoothly changing contrast mask of great benefit, but it too can fail where high-contrast edges are encountered. A small but critical modification to the Retinex equation—the introduction of a ratio modification operator—changes the nature of the generated contrast mask, so that it is simultaneously smooth in regions of small contrast ratios, but extremely sharp at high-contrast edges. A mask produced in this way compresses large and undesirable contrast ratios while preserving, or optionally enhancing, small ratios critical to the sensation of image contrast. Processed images may appear to have a greater contrast despite having a shorter global contrast range. Adjusting the new operator prior to processing gives control over the degree of compression at high-contrast edges. Changing the operator during processing gives control over spatial frequency response.