Duotone Generator
Map an image's shadows and highlights onto two colors, preview the real gradient map and export PNG, SVG filter or CSS.
Image and duotone colors
No image loaded — showing a generated sample gradientClick the preview to sample a color, then apply it to an endpoint.
Duotone preview
#0f4c5c → #ff7a59Preview updated for No image loaded — showing a generated sample gradient.
<filter id="duotone" color-interpolation-filters="sRGB">
<feColorMatrix type="matrix" values="0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0" result="gray"/>
<feComponentTransfer in="gray">
<feFuncR type="table" tableValues="0.0588 0.1216 0.1843 0.2471 0.3098 0.3725 0.4353 0.4980 0.5608 0.6235 0.6863 0.7490 0.8118 0.8745 0.9373 1.0000"/>
<feFuncG type="table" tableValues="0.2980 0.3098 0.3216 0.3333 0.3451 0.3569 0.3686 0.3804 0.3961 0.4078 0.4196 0.4314 0.4431 0.4549 0.4667 0.4784"/>
<feFuncB type="table" tableValues="0.3608 0.3608 0.3608 0.3569 0.3569 0.3569 0.3569 0.3569 0.3529 0.3529 0.3529 0.3529 0.3529 0.3490 0.3490 0.3490"/>
</feComponentTransfer>
</filter>Apply with filter: url(#duotone) after embedding the filter in your page.
Examples
Spotify treatment
Shadow #1a1a2e, highlight #e94560Teal-to-pink gradient mapThe LUT remaps every luminance step, preserving highlights.
Noir
Near-black to warm white, gamma 1.2High-contrast monochromeGamma shifts midtones without moving the endpoints.
Approximate CSS
grayscale + contrast + tintVisible but not identicalThe interface labels this export as approximate.
About this tool
Duotone Generator remaps an image's tonal range onto two colors: shadows take the shadow color, highlights take the highlight color, and midtones interpolate between them. A 256-entry lookup table built from Rec.709 luma gives a true gradient map, not a grayscale-plus-filter approximation.
Adjust the gamma curve to darken or brighten midtones without moving endpoints, optionally add a third mid color, and choose from curated presets such as Spotify teal/pink, noir and sepia. The preview processes a downscaled copy for responsiveness while the export path works at full resolution with a documented cap.
Exports include PNG, JPEG and WebP images plus an SVG feComponentTransfer filter that compiles the same LUT into per-channel tables. A CSS filter chain is also provided, explicitly labelled approximate because a filter chain cannot reproduce an arbitrary gamma curve. Images are processed entirely in the browser.
What this tool does not do
- Only the first frame of an animated GIF is processed.
- Very large images are downscaled for preview and capped for export.
- CSS filter output cannot reproduce gamma curves or arbitrary three-color maps.
How to use this tool
Load an image
Drop a file, paste from the clipboard, or choose one of the bundled sample photos.
Pick two colors
Set shadow and highlight colors with the pickers or load a preset; tune gamma to reshape midtones.
Compare exports
Switch between the exact SVG filter and the approximate CSS chain; read the label before copying.
Download
Choose PNG, JPEG or WebP and download the full-resolution result.
Use cases
Social graphics
Apply a consistent two-color treatment to campaign imagery.
Hover effects
Copy the SVG filter or CSS approximation for a site interaction.
Stock photo restyling
Uniformly recolour a set of images without installing an editor.
Exports
| Format | Notes |
|---|---|
| PNG | Default; preserves transparency through the LUT pass |
| JPEG | Quality-controlled; transparent pixels are flattened because JPEG has no alpha |
| WebP | Compact output where the browser supports WebP encoding |
| SVG filter | feColorMatrix desaturation plus feComponentTransfer tables; needs sRGB interpolation |
| CSS chain | Approximate hover effect only — gamma and a third anchor are not representable |
Canvas re-encoding strips EXIF metadata from exported images.
Common mistakes
Mistake:Expecting a CSS filter chain to match the downloaded image.
Fix:Only the SVG filter carries the LUT; the CSS chain is explicitly approximate.
Mistake:Using identical endpoint colors and wondering why the image is flat.
Fix:The tool shows an endpoints-identical hint.
Mistake:Exporting a transparent image as JPEG.
Fix:Choose PNG or WebP when alpha matters; JPEG composites transparency.
Mistake:Assuming EXIF survives.
Fix:Canvas re-encoding strips metadata, which is a privacy benefit.
Frequently asked questions
How is this different from grayscale plus a CSS filter?
A CSS chain applies an affine transform to luminance, so it cannot reproduce a gamma curve or a three-color map. This tool builds a 256-entry lookup table and recolours each pixel from its Rec.709 luma — the downloaded image is a true gradient map.
How do I keep skin tones natural?
Choose a shadow and highlight pair close to the original tonal range and keep gamma near 1. Strong complementary pairs such as teal/pink intentionally stylise skin; a third midtone anchor can soften the transition.
Can the SVG filter run on a live website?
Yes, as an inline SVG filter in the same document: add the <svg><filter> element and apply filter: url(#duotone). Do not rely on cross-document external filter references — Chromium does not support them.
Which export formats are available?
PNG by default, plus JPEG with a quality setting and WebP. PNG and WebP preserve transparency; JPEG has no alpha, so transparent pixels are flattened.
Are my photos uploaded?
No. Decoding, LUT mapping and export all happen in the browser. Canvas re-encoding also strips EXIF metadata from the downloaded file.
What does gamma do?
Gamma reshapes midtones before the color lookup: values below 1 lift midtones, values above 1 darken them. Both endpoints stay at your chosen colors, which is why gamma is the cleanest way to adjust overall mood.
References & standards
Related tools
CIELAB Color Explorer
Convert colors to CIELAB/LCh and XYZ, explore a*–b* and L*–C* slices, and compare colors with ΔE76 and ΔE2000.
CMYK Color Converter
Convert hex/RGB to CMYK percentages and back with total ink limits, rich-black recipes, batch conversion and a print preview.
Color Blindness Simulator
Simulate color blindness on palettes and images. Compare protanopia, deuteranopia, tritanopia, and more side-by-side.
Color Contrast Checker
Advanced WCAG accessibility compliance checker with color blindness simulation, multiple text sizes, and comprehensive analysis features.
Color Converter
Convert colors between multiple formats (HEX, RGB, HSL, HSV, CMYK, LAB) with color blindness simulation, named colors, and batch processing
Color Extractor
Extract colors from uploaded images by hovering over pixels to get precise color values.