Results 1 to 6 of 6

Thread: Image Sprites???

  1. #1
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default Image Sprites???

    I have a VERY important question for anybody who knows anything about images or sprites.

    To the point:

    You know how sometimes when you want to make an image that will have the background blend in with the webpage around it? Yeah. That's my problem. I want to make an image that will have it's background blend in with the webpage - also: I really also wish to make images of which background will blend in with ANYTHING!! I know that this is possible, but I don't know how to do it... I have heard that you change the background color to like "light green" or whatever. I am not sure. I just want to have the background blend in - specifically with a C++ game I made. Would you have to do something with a paint program?

    Please help! Help is URGENT!!

    -magicyte

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Use a PNG with transparency! Go from your solid color/image to transparent. That way, it doesn't matter what the background is.

    Is that what you're going for?

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    By 'light green' you were probably thinking of GIF transparency. In GIF, one assigns a certain colour out of the 256-colour palette to be transparent, and then every pixel of that colour is rendered as being completely transparent. PNG doesn't do this: instead, it has a separate 'alpha' field for each pixel, along with the red, green, and blue fields, whose value denotes the level of opacity the pixel should have.

    Of course, it's also possible to implement GIF-like transparency in your own application, simply by not rendering any pixels of your chosen colour. Using the built-in GIF transparency, however, will allow the sprite designers to worry about choosing an appropriate transparent colour for which they didn't have another use.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    @ Medyman

    Could you explain how to do that with a paint program? You know, just explain the process of making the background transparent (namely with Paint.NET). Thanks for your post!

    @ Twey

    Yeah. GIF transparency. Save the fact I make PNG and BMP images... Could you explain how I would change the level of opacity of a pixel, or as you say, "alpha field for each pixel".

    All I need to know is how to make my PNG or BMP pixels transparent. Then I'm good to go. You see, I am taking on the mission of making a game similar to The Legend of Zelda game for the NES in JavaScript. Thanks for your post!

    Thanks, you guys, for giving me advice.

    -magicyte

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I don't know about Paint.NET, but with a good image editor like the GIMP, you can set the alpha of colours in the colour selector, or do a layer-wide 'colour to alpha' operation. It's probably similar in PaintShop. BMP does not support transparency (and you should never use BMP for anything — it's virtually feature-free and uncompressed, so it has a huge filesize, whilst not storing anything that PNG doesn't).
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Alright. I just found out how to do it with Paint.NET. Thank you all!!

    -magicyte

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •