There are times when you don’t have the original graphics for a project and must make do with a JPEG as your starting point. Let’s say you are given this JPEG and are asked to switch the white background to a transparent background.
Use Photoshop’s Magic Eraser Tool with the tolerance set to 70. Now save it as a PNG-24 and as a GIF-128 Dither.
GIF-128 Dither: Notice the white fringe. This is because GIF can not do alpha transparency; pixels are either 100% opaque or 100% transparent.
PNG-24: Much better because the outside edge has a smooth gradient of transparency. This comes at the cost of a larger file size (in this instance, because of the solid colors).