Sprite and transparency

I got a sprite with a white background but I would like the background transparent …
How do I get there? It looks like this:

You could replace all the white pixel values with color(0,0,0,0). But the border will not be nice.

Setting the background to rgb(256,256,256) didnt work, but I found and erase tool (erase pixel data). That did the trick.