1

If you take an existing image that has a shape on a white background and you want to make the background transparent it's relatively simple to use the magic wand tool to select the background, delete it and then save the image as .gif or .png.

But that only works if the edges are solid and there's no zone where white is mixed with the color of the shape.

However, if you have an image like this: https://i.stack.imgur.com/evuFa.jpg where the color changes gradually from solid color of the shape to white background you need to fix all pixels that have a combination of white and the shape color.

What's a good way to do that?

0

1 Answer 1

0

It's a GIF, and is therefore in Indexed colour. You can't have semi transparency in GIFs. The format doesn't support it. You can only have either full opacity (100% solid), or full transparency.

A workaround:

If you have edges with semi transparency/anti-aliasing, when converting to Indexed mode or exporting as GIF, some raster image editors have a setting called a "matte" or "matting" which can be used to fill these outer pixels with a colour to match a background colour on a web page.

Sorry I'm not a Paint.NET user and don't know if has this feature.

Photoshop can create a matte when exporting as GIF, and GIMP can do it too, where it can be achieved using the "semi-flatten" filter on each layer before exporting as GIF.

4
  • What if the Gif was converted to Png, which I believe also can do animation. Mar 5, 2021 at 4:05
  • @ArtGhangsta The PNG format doesn't support animation. However APNG does, but that format doesn't have much support in web browsers.
    – Billy Kerr
    Mar 5, 2021 at 10:51
  • i see. That means the .png files i've been using which are animated are APNG files but named png. They seem to work fine in the browsers I'm using. Apr 4, 2021 at 5:40
  • @ArtGhangsta See caniuse.com/apng for a list of browser support for APNG
    – Billy Kerr
    Apr 4, 2021 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.