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?