How the two colours are applied
The loader refuses non-image types and files over 15 MB, then reports the name, dimensions and byte count in that line. Per pixel, brightness comes from the channels weighted 0.299, 0.587 and 0.114, divided by 255, plus the Brightness slider as a fraction. Contrast pivots around the midpoint by scaling luma minus 0.5 by one plus itself over 100, and the answer is clamped between 0 and 1. That single number walks a straight line from the dark swatch to the light one.
A worked example
At the defaults, dark #0f172a and light #f97316 with Contrast 10, a grey pixel of 128, 128, 128 reads luma 0.50196, moves to 0.50216 and prints rgb(133, 69, 32), which is #854520. Pure black computes -0.05, clamps away and so reproduces the dark colour exactly. Raise Contrast to 80 and a light pixel of 200, 200, 200 overshoots to 1.01, clamps and burns out to plain #f97316. Gradient mix at 50 on that same grey returns rgb(130, 99, 80), the washed comparison view.
Preview versus download
The canvas fits inside 1200 by 1200 and never enlarges, so a 4000 by 3000 JPEG shows at 1200×900 with the note reading "1200×900 preview. The download uses the original 4000×3000." Download PNG reruns the identical loop on an offscreen canvas at native size and saves duotone.png. Seven presets fill the two colour boxes only, and Swap colours exchanges them and resets the menu to Custom.
Where it stops
- The copy-filter button emits a three-rule approximation at full strength: the light colour behind, a grayscale image multiplied over it with the current Contrast and Brightness, and the dark colour screened on top; the canvas partial mix cannot be reproduced exactly.
- Two colours is the whole model, with no mid-tone ink or per-channel curve.
- Both passes loop over every pixel in JavaScript, so a twelve-megapixel export can stall the tab.
- Alpha survives untouched, keeping transparency but leaving hidden pixels unmapped.
- HEIC and some animated files end with the generic decoding failure line.
Questions people ask
Is the photo uploaded anywhere
No. It becomes an object URL read by a canvas, and preview and export both run in the page.
Why did my dark picture flatten
Positive contrast stretches shadows into the clamp, so pulling the slider below zero brings detail back.
Can I build the pair from one brand colour
The shade generator proposes tints and shades for the two boxes, and the filter builder covers the CSS route.