Why Do Sprites Have Colour Behind them?

JoshKahaneJoshKahane Member Posts: 470
Hi

I was wondering as now I have many sprites I am going to use in my new game, why do they have colour behind them?

Everywhere you see them they have for example a bright green or blue or pink background behind them. Whats the reason for this?

I need my sprites with transparent backgrounds and its going to take me an absolute age to change this, I have hundreds. Just wondering. Thanks. :)

Comments

  • PatronusPatronus Member Posts: 56
    There is a specific way of saving bitmaps so that they have a transparent area. I assume you know this so I won't go into it.
    I have noticed that, when I create a bitmap on my PC, it is not transparent on the iPhone even though it is transparent on GS. When I load and simply save it again on the Mac it is fixed. This is a long shot but perhaps it helps.
  • JoshKahaneJoshKahane Member Posts: 470
    Oh I actually did not know this. So somewhere in Windows can I open my sprites and re-save them with a transparent background? Thanks for quick reply.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I once used a pc program called gamemaker (it sucks comapred to GS). In that program you could not use png files or gif files which use transparency so they had this weird (to me anyways) workaround. In that program (and maybe others for all I know) the bottom left pixel determined the transparency. So if the bottom left pixel was bright green. Any other pixel in the image file of that exact same bright green color would be translated by the game engine and converted into transparent. This may be why the non-png file sprites have a background color (it's probably a color that is not used anywhere in the sprite itself). I would use photoshop, gimp, pixen, pixelmator, etc. and set the paintbucket tool to clear (photoshop) or use the magic eraser (pixelmator) to get rid of the background and then save the sprite as a png file which allows transparency.
  • JoshKahaneJoshKahane Member Posts: 470
    Here is an example of one of my sprite sheets. It has a pink background so what do I do. I have found that I can't simply take it into photoshop and remove the pink and its is far to much of an annoying detailed object.

    http://img412.yfrog.com/i/trees2tileset.png/
  • JoshKahaneJoshKahane Member Posts: 470
    Ahh I see thats makes a lot of sense Scitunes, thanks. Only if you see the sprites I linked above, thats my difficulty in removing the colour.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    If you use photoshop (gimp is a free photoshop clone) you can set your paint bucket to "clear" and in one click all of the purple would be gone.
  • JoshKahaneJoshKahane Member Posts: 470
    Ooh, I just discovered a really neat trick in photoshop which makes the process fairly quick of removing the colour. And this method only selects the one individual colour unlike the magic wand which may spill out or something.

    Use selection tool and select the tree like in image linked above for example. Then go Select > Color Range. Here with the eye dropper select the colour you want to remove and click Ok. Then goto Select > Inverse Selection and press Delete. Done! :)

    Not great but does the job. Thanks guys.
  • EastboundEastbound Member, BASIC Posts: 1,074
    Like Scitunes said, GIMP has a fill bucket that does transparency and works great (that's what I use). It would be especially easy for sprite sheets.

    And Scitunes you didn't like Game Maker?! Man I loved that program.
  • JoshKahaneJoshKahane Member Posts: 470
    Ahh in GIMP ok, wondered why I couldn't find it in Photoshop, hehe. I think I will have to download IMP and give it a shot sound very easy and should save me time hopefully. :) Thanks guys.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    @Eastbound - Not compared to GS!

    @Kahanejosh - In photoshop click on bucket. Towards top of screen but under the main bar you should see a pulldown menu that probably says "normal". Change that to "clear". then click on the background you want to get rid of.
  • JoshKahaneJoshKahane Member Posts: 470
    Aha! Thats brilliant Scitunes! Thanks works a charm and is even faster! Thanks.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Glad to help! I wouldn't have a single game if not for these forums. Just paying it forward
Sign In or Register to comment.