Text-Only Theme Inverter
Invert only likely text pixels while leaving the logo/icon colors untouched.
How to use
- Drag an image onto the drop area or click it to browse. A logo with a coloured icon and a black, grey or white wordmark works best.
- Check the file name, dimensions and size in the info bar, then compare the Original preview (on a light background) with the Processed preview (on a dark background).
- Pick a Text Detection Target. Dark Text inverts dark neutral pixels, which suits a logo you want to use on a dark site. Light Text inverts light neutral pixels, for a light site. Both inverts either kind.
- Adjust the Neutral Threshold if the icon is changing or the text is missed, and the Brightness Threshold to decide how dark or light a pixel must be before it flips.
- Download the result as PNG or WebP. Upload New Image starts again with another file.
Worked example
Imagine a logo with a purple symbol and the company name in near-black. On a dark website the name disappears. Load the file and leave the target on Dark Text with the default thresholds (38 and 155).
The purple pixels have a wide spread between their red, green and blue values, so they are not treated as neutral and stay as they are. The near-black letters have almost equal channel values and low brightness, so they flip to near-white. The preview on the right shows the symbol unchanged and the name now readable.
If the edges of the letters look dark or ragged, the anti-aliased pixels between the text and the background were only partly caught. Raise the Brightness Threshold a little. If part of a dark grey icon turns white, lower the Neutral Threshold so fewer pixels qualify as neutral.
How it works
The page reads every pixel of the image from a canvas and makes a separate decision for each one. A pixel is only a candidate if it is neutral, meaning the gap between its largest and smallest colour channel is no more than the Neutral Threshold. Black, white and greys all pass. Saturated colours do not.
The page then measures the pixel's brightness with the standard weighted formula, where green counts most: 0.299 red + 0.587 green + 0.114 blue. For Dark Text, a neutral pixel is inverted when its brightness is at or below the Brightness Threshold. For Light Text, it is inverted when its brightness is at or above 255 minus the threshold. Inverting means replacing each channel value with 255 minus that value, so black becomes white and mid grey stays near mid grey.
Fully transparent pixels are copied untouched, and the alpha value of every other pixel is kept. The result is written to a second canvas and exported with the browser's PNG or WebP encoder. PNG is lossless. The WebP download uses a high quality setting of 0.95, which is lossy, so choose PNG when you need exact pixels.
The method is a simple rule, not image recognition. It cannot tell text from a grey shape, so a black or grey icon is treated like black or grey lettering. Photographs are a poor fit, because they contain many neutral tones that are not text.
Privacy
The image you choose is read in your browser and processed on your device. It is not uploaded, and the tool sends nothing to the site or to any other service. The standard analytics and ad scripts load separately on every page and do not receive your file. See the privacy policy.
Frequently asked questions
Why did my icon change colour as well?
The icon probably contains black, grey or white pixels, so it passes the neutral test. Lower the Neutral Threshold, or recolour the icon in an image editor first so it is no longer black or grey.
What is the difference between the two thresholds?
The Neutral Threshold controls how colourless a pixel must be. The Brightness Threshold controls how dark or light it must be. A pixel has to pass both before it is inverted.
Does it keep transparency?
Yes. Transparent areas stay transparent and partly transparent pixels keep their alpha value. Both PNG and WebP downloads can store it.
Can I use it for a screenshot or a photo?
It is built for logos and flat graphics. On photos and screenshots it will invert many neutral areas that are not text.
Related tools
- Logo Edge Cleaner for removing light fringes from the edges of a transparent logo.
- Image Converter for converting the result between WebP, PNG and JPEG.
- Contrast Checker for testing whether your text colour is readable on its background.
- All image tools