piece bitmaps - how to get a transparent background

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

piece bitmaps - how to get a transparent background

Postby gmseed » 23 May 2011, 20:23

Hi

I downloaded the xboard source code and was intending to use the bitmaps in the winboard directory.

However, I notice that they are on a white background and wonder how they are used in xboard so that the white background is not shown.

Thanks.

Graham
gmseed
 
Posts: 2
Joined: 23 May 2011, 13:03

Re: piece bitmaps - how to get a transparent background

Postby H.G.Muller » 23 May 2011, 22:06

The WinBoard bitmaps (*.bmp files) are monochrome bitmaps. The routines in WinBoard that render a piece use the set bits in them (those that display as black when you view the bitmap with, say, MS Paint) to either clear an area of the complete board bitmap that is being drawn, or set it to given color. For the white (outline) pieces this requires two bitmaps: one (the *w.bmp) for setting the white background, the other (*o.bmp) for drawing the black outline over it. The black pieces need only a single bitmap (*s.bmp), as their small 'internals' are transparent.

When I wanted to use them for my viewer webpage, I loaded the *o.bmp and *s.bmp bitmaps in another drawing program (IrfanView), floodfilled the exterior with another color, designated that color as transparent, and then saved them as 16-color gif files.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: piece bitmaps - how to get a transparent background

Postby gmseed » 24 May 2011, 19:49

Hi

Thanks, that's very helpful.

Graham
gmseed
 
Posts: 2
Joined: 23 May 2011, 13:03


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 10 guests