Image guides

Follow the shadow and highlight colors through a duotone PNG

·

A duotone effect maps how light each source pixel is to a point between two chosen colors. Start with a handful of known pixels so the endpoints and alpha are easy to inspect.

Duotone Image Generator

Check the shadow and highlight endpoints

Select Load example and Apply duotone. Use Shadow color #102040, Highlight color #F0C880 and Intensity 100%. Download the 4 × 2 PNG. Compare the pixels in this table using one-based positions.

Check the shadow and highlight endpoints
Sample positionOriginal RGBASaved RGBA
Top row, fourth255, 255, 255, 255240, 200, 128, 255
Bottom row, first0, 0, 0, 25516, 32, 64, 255
Bottom row, second64, 128, 192, 12862, 66, 77, 128
Bottom row, third18, 37, 92, 018, 37, 92, 0

W3C relative luminance formula for sRGBW3C Portable Network Graphics Third Edition

Measure light before choosing a new color

The tool linearizes the 8-bit sRGB channels and combines them with relative luminance weights of 0.2126 red, 0.7152 green and 0.0722 blue. Pure green therefore lands closer to the highlight than pure blue.

Luminance chooses the position between the chosen colors. The tool interpolates their encoded sRGB channels and rounds the output to 8-bit samples.

W3C relative luminance formula for sRGBW3C Portable Network Graphics Third Edition

Blend the effect with the original

Set Intensity to 50% and apply again. The red top-left pixel now stores 159, 34, 39, 255. The tool blends the original and candidate colors before rounding once.

Open both downloads and compare a transparent edge. The original alpha is preserved at every intensity.

W3C Portable Network Graphics Third Edition

Common questions

What happens if I choose the same color for shadows and highlights?

All visible pixels map to that same color at 100% intensity. Their original alpha is preserved.

Why can the source preview have different dimensions than its encoded header?

The local decoder applies supported orientation metadata before mapping the displayed pixels.

Sources

Put it into practice.

Related guides