Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / problem with my sprites

Author
Message
Plastico
21
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 9th Jul 2004 14:20
Is there a way I can get the excess color from my image I try to load. what I mean is, when I load my image over my bitmap, there is still white around it from ms paint....if that makes any sense..

game tricking
20
Years of Service
User Offline
Joined: 5th Jul 2004
Location:
Posted: 9th Jul 2004 21:35
Is the background of the fish image black? If you make everything you dont want to see of the fish black, then the black will be transparant - i hope that makes sense.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Jul 2004 23:10
Alternatively, you can use the SET IMAGE COLORKEY command to set white to transparent.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Plastico
21
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 10th Jul 2004 02:55
ok thanks, that helped me alot.
Plastico
21
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 10th Jul 2004 03:13
erm, its not working for some reason, the white block is still around the fish.

Plastico
21
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 10th Jul 2004 03:19
ok, I tried putting my image colorkey at the beginning, but it only took about half the block of white away, there is still a few spots left.

heres the code.

game tricking
20
Years of Service
User Offline
Joined: 5th Jul 2004
Location:
Posted: 10th Jul 2004 03:24
Probably because the white that is left is not really white -its offwhite. You may have to go in and play with the image so it has no offwhite pixels
Plastico
21
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 10th Jul 2004 13:14
I do get rid of the off white pixels, but whenever I save it, the pizels return to there normal way...?
zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 10th Jul 2004 13:50 Edited at: 10th Jul 2004 14:37
Never use the .jpg format when working with pixel art or 2d images for sprite. the .jpg compression has a tendency to add artifacts that make your images appear to have a halo or outline effect. The same thing happens when using automatic anti-aliasing. For MS paint images be sure to save your work as .gif or possibly .png or .tga. I would use .gif. Once you save it as a .jpg and artifacting has taken place you will either need to redo the artwork or touch it up by hand.

To see if this has happened to your image. find the pixels that are still showing through. Is the color the same as your transparent color or slightly off?

It would also help if you let us know if any of the pixels that should be transparent are indeed transparent? if not the following suggestions may help you




also, set image colorkey must be place before any load image commands.

Second you could try adding a ,1 to your load image command if it is to be use as a 2d sprite and not a 3D texutre.

load image "filename",imagenumber,1

also note when using get image and paste image there are aslo optional parameter for those commands. add ,1 to paste image and get image if you plan on using them. I had this happen to me when I was calling a subroutine multiple times, that would load images and a function to paste images. Without the added texture parameter (,1) I would have transparency on the 1st image and then it would fail for all consecutuive images.

Hope that helps.

~zen


Plastico
21
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 10th Jul 2004 14:16
much thanks zen, you are a big contribution to the website. I will try your advice now.
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 12th Jul 2004 08:29 Edited at: 12th Jul 2004 08:31
Plastico, do you have a good paint program like Photoshop CS or Paint shop pro?

If so, you might want to use .PNG instead. DBpro uses the alpha values instead of a colorkey for transparency with .PNG

This is how I create my .PNG sprites in photoshop CS:

-Draw a sprite in mspaint (easier and better) and keep the transparent parts black (rgb 0,0,0)

-Copy the image

-Open Adobe Photoshop CS and create a new image (normally the new image sizes are the same, I think Photoshop scans the clipboard) and make sure the background option is set at "transparent"

-Paste the image

-Use the selection wand (magic wand or something) and click on the black parts (if you need to, you can right-click on a black part and select "add to selection")

-Click on layer at the top, and select "Add layer mask -> reveal all"

-Make sure the new alpha-layer is selected in the layer window

-Draw the selected pixels black

-Select the normal layer again

The big advantage of a alpha map/layer, is that it can hold shades (rgb 0,0,0 -> rgb 255,255,255) so that you can make windows that are 30% opaque, laser lights, explosions and such. Pretty cool!

I dont know how to do it in other programs though, but it should be the same.

Note: I only use .png for the bigger sprites, small sprites (16x16 pixels) are smaller in .bmp than .png , but big ones (150x150) are 10 times smaller in .png than .bmp

Plastico
21
Years of Service
User Offline
Joined: 3rd May 2004
Location:
Posted: 13th Jul 2004 15:49
so much to learn,

thank you baal

Login to post a reply

Server time is: 2025-05-15 10:30:08
Your offset time is: 2025-05-15 10:30:08