0
\$\begingroup\$

I am making a game using pyGame; it is basically a space invader game, with a tank.

Game screenshot showing forest scene with a tank sprite inside a white rectangle

As we can see, this tank image I have has white borders / a white background, which I really want to get rid of.

I am thinking of editing it out, but it would be replaced by a different colour. Is there any way to somehow cut out this tank image from its original rectangular box?

\$\endgroup\$
1
  • \$\begingroup\$ Tip: a "boarder" is someone who is living in your home temporarily. A "border" is a line around the perimeter of a shape. What you have here though isn't just a white outline, the whole background of the sprite is white. \$\endgroup\$
    – DMGregory
    Commented Apr 2, 2019 at 11:12

1 Answer 1

6
\$\begingroup\$

Use a file format that supports alpha (png), an editor that can save it with a transparent background (gimp2, photoshop, basically not paint) and make sure you load the sprite correctly

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I would like to add that even with all those done correctly, he can have this issue because of a simple mistake: many programs start with another layer which is a white background. Please make sure you remove / make it invisible before exporting. \$\endgroup\$
    – lilKriT
    Commented Apr 3, 2019 at 2:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .