Duotone Image Maker
Operator: Abdulla Al Fahad. How tools are built and checked
A duotone drops a photo's colours and re-tells it in two inks: the darkest parts take one colour and the lightest parts take another, and everything between is a blend. With a third colour in the middle it becomes a tritone. The look ties a set of mismatched photos together, which is why it shows up on banners, album covers and article headers.
The recipe is a gradient map with a handful of numbers: two or three colours, contrast, brightness and a blend. Because it is so small, it can be applied to a whole folder: load up to 20 pictures and download them as one ZIP with an identical treatment.
Key features
- Two-colour or three-colour gradient with a movable midpoint
- Eight presets and free colour pickers
- Contrast, brightness, invert and a 0 to 100 percent blend with the original
- Before and after slider on the preview
- Up to 20 images in a batch with the same settings
- PNG or JPG per image, or a single ZIP of everything
How brightness becomes a gradient
A session holds up to 20 pictures (a GIF gives its first frame). The on-screen preview is made at no more than 1200 pixels on the longest side so sliders respond immediately; saved files are produced from the original at up to 4096 pixels on the longest side. Larger pictures are reduced to that size, with a note about it.
The gradient is two or three hex colours, called shadows, midtones (optional) and highlights. Eight presets are included, such as Midnight pink, Ocean, Sunset and Warm sepia. With three colours, a slider places the middle colour anywhere between 5 and 95 percent of the brightness range. An invert switch swaps the ends.
Contrast and brightness range from -100 to 100 and are applied to the brightness value before it is looked up in the gradient, which is how you control where the shadows and highlights fall in the picture. The Amount slider blends the result with the original photo, from 0 percent (untouched) to 100 percent (pure duotone), so you can keep a trace of the real colours.
Transparency is preserved: alpha is copied straight across. Output is PNG, or JPG with a quality setting; for JPG the transparent areas are filled with white because the format has no alpha.
How it works
Each pixel is reduced to one brightness number from 0 to 255 by weighting its red, green and blue values at 0.2126, 0.7152 and 0.0722, the Rec. 709 coefficients, which make green count most because the eye is most sensitive to it. Contrast uses the classic formula factor = 259 (c + 255) / (255 (259 - c)), applied around mid grey at 128, and brightness adds up to 255 levels at a setting of 100.
The result indexes a 256-entry table that was built once for the whole image. Entry 0 is the shadow colour, entry 255 is the highlight colour, and the entries between are interpolated per channel in sRGB across one or two segments. Building the table once and looking up each pixel keeps the per-pixel work small, which is why the preview follows the sliders as you drag.
Typical uses
- Giving a set of mixed team photos one look for an About page
- Cover art for a playlist or podcast built from a single photo in two brand colours
- A tinted background image for a hero section that keeps the text readable
- A sepia tritone for an old-photo feature, with a warm midtone
- Posters where the original picture shows through at a 25 percent blend
Building one
- Add one image, or up to 20, by dropping them or choosing files.
- Choose a preset or set your own shadow, midtone and highlight colours.
- Drag the before and after slider while changing contrast, brightness and Amount.
- Save the selected image, or process all of them into a ZIP.
Example
A mid-brightness pixel, Midnight pink preset, contrast 0, brightness 0
pixel RGB (120, 140, 160)
gradient #1b0b3a to #ff4d8dThe lookup
grey = 0.2126x120 + 0.7152x140 + 0.0722x160 = 137.2 -> 137
t = 137 / 255 = 0.537
R = 27 + (255-27) x 0.537 = 149.5 -> 150
G = 11 + (77-11) x 0.537 = 46
B = 58 + (141-58) x 0.537 = 103
result (150, 46, 103)Tips for best results
- Pick a dark shadow colour and a light highlight. If both ends are mid-tones the picture loses all its depth.
- Add a third colour at 40 to 60 percent when two colours look flat; sunset and sepia use this.
- Raise contrast by 15 to 30 for hazy photos and lower it for harsh ones, because the gradient is stretched to whatever brightness range is left.
- For text over the image, move the midpoint towards the dark end so the busy middle of the tone range stays darker.
- Use an Amount of 70 to 85 percent to keep skin tones recognisable while still tinting the picture.
Things to check before you rely on it
Colour information is discarded at 100 percent. Two objects of different hue but equal brightness end up the same colour.
JPG output has no transparency, so transparent areas become white; use PNG to keep cut-outs.
The same settings apply to the whole batch. A very dark and a very bright photo may need different contrast, so check a few in the preview.
Pictures over 4096 pixels are reduced; the page does not enlarge anything.
Animated GIFs give one frame, and the result is a still image.
Common errors and how to fix them
- Up to 20 images at a time; some files were not added
- Process the first set into a ZIP, remove them, then add the next. Each batch keeps the settings you chose.
Best practices
- Write down the three hex codes of a look you like so a later batch matches it exactly.
Frequently asked questions
What is the difference between duotone and a sepia filter?
Sepia is one fixed brown-ish gradient. Here you choose both colours, add a third if you want, and control the blend, so sepia is just one preset.
Can I keep some of the original colour?
Yes, lower Amount. At 80 percent the picture is mostly duotone with a trace of its own colours.