Questions about Loading of in game sprites

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
User avatar
accucore12
Posts: 14
Joined: May 18th, 2012, 1:06 pm

Questions about Loading of in game sprites

Post by accucore12 » May 25th, 2012, 5:10 pm

Images often come in certain dimension (width x height ) ,so my interpretation of it is that it would come in a rectangular form.However In games we do not see any border around any of the sprites, there is no visible border. So how did it manage to make certain parts of the picture transparent and not show. I would want to know the usual way in which they do that.

Code: Select all

Occupation: Reverse Engineer
[/color]

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Questions about Loading of in game sprites

Post by LuX » May 25th, 2012, 7:45 pm

There's just no pixel there, so it wont get drawn...? Or rather if the pixel has a certain value or information it wont be drawn.
ʕ •ᴥ•ʔ

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Questions about Loading of in game sprites

Post by chili » May 26th, 2012, 1:33 am

There are three main ways to implement sprite transparency. The first is using a colorkey, wherein a certain color is chosen to represent a transparent pixel. The second is adding a separate alpha channel to the pixels (RGBA), wherein the value of the alpha channel determines how opaque its corresponding pixel is. The third is masking, where a separate image is used as a mask to show which pixels will be drawn.
Chili

User avatar
accucore12
Posts: 14
Joined: May 18th, 2012, 1:06 pm

Re: Questions about Loading of in game sprites

Post by accucore12 » May 26th, 2012, 6:15 am

chili wrote:There are three main ways to implement sprite transparency. The first is using a colorkey, wherein a certain color is chosen to represent a transparent pixel. The second is adding a separate alpha channel to the pixels (RGBA), wherein the value of the alpha channel determines how opaque its corresponding pixel is. The third is masking, where a separate image is used as a mask to show which pixels will be drawn.
Thanks for the reply ,i have some queries on the details.
For the first way, what if the image has a pixel of that color that is use to represent the transparent pixel, wouldnt that image not be represented correctly?

Regarding the second way, with the Alpha channel method, does this only apply to certain type of images with alpha values.How about images like 24bit ,8 bit, 1 bit?

Is there any instance in which a particular case is prefered?

Code: Select all

Occupation: Reverse Engineer
[/color]

Post Reply