Invert Image Colors
Open a picture and every colour flips at once. Pick a quick setting or move the amount.
https://flxcode.com/invert-image-colors/
or drop it here, or paste with Ctrl+V
JPG, PNG, WebP, HEIC, AVIF, GIF and BMP, up to 25 megapixels. Nothing is uploaded.
Works offline: load this page, edit one picture, turn off Wi-Fi, edit more. A JPG has no see-through areas, so they turn white.
Nothing you open or type is uploaded. How we count What this tool keeps and sends.
Problem or idea? Email us
How to invert a picture
- Choose a picture, or drop or paste one. It opens in this tab.
- The result shows next to the original. Try "Dark mode screenshot" for a page of text, "Plain invert" for the classic negative.
- Change the amount or switch single colour channels off. Undo steps back through your changes.
- Press Save as PNG, or Save as JPG for a smaller file.
What invert does to each pixel
Each pixel has three colour values from 0 to 255: red, green and blue. Invert turns every value v into 255 minus v. Black becomes white, mid grey 128 becomes 127, and pure red becomes cyan. Apply it twice and you get the original back, exactly. In hex it is easy to check by hand: 255 is FF, so subtract each pair of digits from FF.
The amount mixes the original and the inverted value. At 50% every value lands on 127.5, which rounds to 128, so the whole picture goes flat grey. The CSS invert() filter works the same way.
This is not what a film negative is. Colour negative film has an orange mask, so a scanned negative inverted here keeps a colour cast. And the see-through channel, alpha, is never changed.
new = 255 - v each of red, green, blue on its own
new = v + (255 - 2v) × amount amount from 0 to 1
alpha stays alpha
lightness only: HSL lightness L becomes 1 - L, hue and saturation stay
Five colours, worked out by this page
Numbers come from the same code as the tool, run when this page was built. The last column flips only the HSL lightness.
| Colour | Before | Plain invert | Amount 50% | Lightness only |
|---|---|---|---|---|
| Pure red | #FF0000 | #00FFFF | #808080 | #FF0000 |
| Black | #000000 | #FFFFFF | #808080 | #FFFFFF |
| Mid grey | #808080 | #7F7F7F | #808080 | #7F7F7F |
| Sky blue | #3A7BD5 | #C5842A | #808080 | #2A6BC5 |
| Orange | #FFC800 | #0037FF | #808080 | #FFC800 |
A pixel with alpha 90 and colour #C82828 comes out as #37D7D7 with alpha 90. Alpha does not move.
What it can not do
- Colours that sit under fully see-through pixels are lost: the browser canvas does not keep them.
- Lightness only works in HSL, which is not how the eye sees brightness. A pure blue and a pure yellow still differ in how bright they look after the flip.
- Pictures go out as sRGB. A wide-gamut or CMYK profile in the original is not carried over.
- Up to 25 megapixels. A JPG is saved at quality 92 and has no see-through areas.
Next: read a colour from a picture · make the file smaller
FAQ
How do I make a dark mode version of a screenshot?
Use "Dark mode screenshot". It flips only the lightness, so a white page turns dark and blue links stay blue. Plain invert would turn them orange.
Does inverting twice give the original back?
With red, green and blue at 100%, yes, byte for byte. Lightness only can be off by one level on some pixels because of rounding.
Why does my scanned film negative look wrong?
Colour negative film carries an orange mask. Plain invert flips the values but keeps that cast, so you get a tinted picture. Take out the cast with a colour tool after.
Can I flip only one colour?
Switch the other two channels off, or use "Blue channel only" or "Red and green only". Each channel is flipped on its own.
More from FLXCode
- Color Picker from ImageClick a picture to get the HEX, RGB, HSL, HSV and CMYK of any pixel, plus its dominant colors. Nothing is uploaded.
- Compress ImageCompress JPG, PNG and WebP by quality or target KB, with a side-by-side preview. Nothing is uploaded.
- Blur ImageBlur a whole photo or drawn rectangles, with a strength you set. Nothing is uploaded, and EXIF data is left out.
- Grayscale ImageTurn a picture grey with Rec. 709, Rec. 601, linear light or one channel. Save as PNG or JPG. Nothing is uploaded.