To use ImageMagick to make transparent background areas out of white, run magick input.png -fuzz 10% -transparent white output.png. The -transparent option turns the given colour transparent and -fuzz lets colours close to it count as a match. For a single file with no install, the free AyeTab Background Remover does the same colour key in a browser tab and keeps the image on your machine.
Both approaches are a colour key. Pick the one that fits the job, not the one you used last time.
The ImageMagick command, piece by piece
magick logo.jpg -fuzz 10% -transparent white logo.png
-fuzz 10%sets how far a colour can be from the target and still be treated as equal. ImageMagick's docs describe it as matching colours that are close to the target, which you need because scanned or compressed white is rarely exact.-transparent whitemakes that colour transparent. It takes any colour value, so-transparent "#f4f4f4"works for an off-white background.- The output must be PNG (or another format with alpha). Writing to JPG drops the transparency.
Put -fuzz before -transparent: it is a setting, and the operator after it uses it. In ImageMagick 7, magick replaced convert as the main command; older ImageMagick 6 installs use convert.
A batch over a folder
for f in *.jpg; do magick "$f" -fuzz 10% -transparent white "${f%.jpg}.png"; done
That is where the CLI earns its place: a loop in a build step or a script that processes a directory of product shots or icons. Run it on a copy of the folder first, since a fuzz value that suits one image can eat into another.
Tuning the fuzz value
| Symptom | Change |
|---|---|
| Grey speckles left in the background | Raise fuzz a few percent |
| White highlights inside the subject vanish | Lower fuzz |
| Background is cream or grey | Sample the real colour and pass it instead of white |
| Pale halo around edges | Lower fuzz slightly, or soften edges in an editor |
The halo is the classic weak spot of a hard key. Edge pixels are blends of the subject and white, and -transparent either removes a pixel or leaves it.
Checking the result
A transparent PNG can look perfect in a viewer that draws it on white, which hides every leftover pixel. Check it against a dark colour instead:
magick logo.png -background "#222" -flatten check.png
-background sets the colour behind the image and -flatten merges the layers onto it, so halos and speckles show up straight away. If the logo will sit on a dark site header, this is the view that matters. When you are happy, the Image Clipper in AyeTab or -trim in ImageMagick removes the empty margin so the asset lines up cleanly in a layout.
When a browser tool is faster
For one image, opening a terminal, remembering flag order and checking the output in a viewer takes longer than the job deserves. The AyeTab Background Remover handles that case:
- Drop the image in, and "Auto from corners" reads the background colour for you.
- A Tolerance slider plays the role of
-fuzz, with a live preview, so you see the result as you drag. - Edge feather and a "Remove colour spill" checkbox deal with the halo that a plain
-transparentleaves. - Download PNG gives you the file.
The keying runs on your device, so an unreleased logo or a customer's asset is not sent to a server. AyeTab is free, needs no account, and the Chrome extension puts the same tools on your new tab and in a side panel, reachable with Ctrl+K or Cmd+K. Its Image Clipper can then trim the empty transparent margin. Grab it at ayetab.com.
Choosing between them
Use ImageMagick when the job repeats: CI pipelines, folders of assets, anything you want in version control. Use AyeTab when it is one image and you want to see the edges while you tune them. For photos of people or cluttered scenes, neither colour key is right; an AI service such as remove.bg, which finds the subject in an uploaded photo, is the better tool there.