Skip to main content

Background Color Changer

Replace a plain background with a colour of your choice, for example to put products on white or give a graphic a brand colour.

Upload an image

Drag and drop files here, or click to browse

Your images are processed in your browser and are not uploaded to Image York.
You retain full ownership of your images. Image York does not store or claim rights. View License

How the colour is replaced

With By colour, the tool takes the most common colour along the image border as the background colour (the "key"), on the assumption that the border is background. Press Pick and click the image to choose a different spot; a 3 by 3 pixel area is averaged so JPEG noise does not decide the colour.

Each pixel is compared with the key using a colour distance weighted for how the eye sees red, green and blue, on a scale where black to white is 100. Pixels within the Tolerance (default 12) become fully transparent. Pixels slightly further away, within the Edge softness band (default 8), become partly transparent, which keeps edges smooth instead of jagged. Pixels right at the edge of the subject that blend its colour with the background are also made partly transparent, in proportion to how much background they contain, so anti-aliased outlines do not leave a halo. Setting Edge softness to 0 turns both off and gives hard edges, which suits pixel art.

By default only background that touches the image edge is removed: the tool starts at the border and spreads inwards through matching pixels, so the same colour inside the subject is kept. Tick Also remove enclosed areas to remove every matching pixel, for example the inside of a letter "O" in a logo. Remove the background colour from soft edges subtracts the old background from partly transparent edge pixels, so a cut-out does not keep a white or green outline.

The removed background is then filled with the colour you choose. For photos on a busy background, switch to Detect subject, which finds the subject with a segmentation model instead of by colour.

Typical jobs

  • Online shop listings that ask for products on a white background: photograph on a plain, evenly lit light grey or white surface, then replace it with pure white (#FFFFFF).
  • Graphics and banners where a flat background needs to match a brand colour.
  • Photo ID backgrounds: some forms specify a background colour. Colour keying works only if the original background is already plain; it cannot change a cluttered room into a plain wall. Check the official rules too, since some authorities do not accept edited photos.

If parts of the subject change colour

That happens when the subject contains colours close to the background, such as a white shirt on a white wall. Lower the tolerance, make sure "Also remove enclosed areas" is off, or pick the background colour from a spot further from the subject. When the colours are simply too similar, switch to Detect subject, which does not rely on colour.

Output

Download as JPG, PNG or WebP at the original size. JPG and WebP have a quality setting (default 90).

Where the processing happens

All processing happens in your browser. Nothing is uploaded; Detect subject downloads its model files on first use.

Questions about this tool

My online shop wants products on a white background. How do I change the background to white?

Open the photo. The fill colour starts as white. If the product was shot on a plain surface, By colour will remove it; otherwise switch to Detect subject and press Remove background. Check the edges, then download as JPG.

Can I change the background of my ID photo to white or blue?

Yes, if the original background is already plain, such as a wall. Choose the colour, check the result and download. Official rules differ by country and some do not accept edited photos, so check the requirements before you use it.

My white shirt changed colour along with the wall. How do I stop that?

Make sure "Also remove enclosed areas" is unticked, so only background touching the edge of the photo is changed. If the shirt still changes, lower the Tolerance or switch to Detect subject, which does not depend on colour.

How do I use an exact brand colour?

Type the hex code, for example #1a73e8, into the box next to the colour picker. The preview updates straight away.

The edges look rough against the new colour. Can I smooth them?

Raise Edge softness a little and keep "Remove the background colour from soft edges" ticked. This makes the edge pixels blend into the new colour instead of keeping traces of the old one.