chess pieces used in program

Discussion of chess software programming and technical issues.

Moderator: Ras

adams161
Posts: 626
Joined: Sun May 13, 2007 9:55 pm
Location: Bay Area, CA USA
Full name: Mike Adams

chess pieces used in program

Post by adams161 »

hi,

I'm working on a chess interface for the servers freechess.org and chessclub.com. Its open source and GPL located at http://www.adam16mr.org/interface-code.html It can load uci and winboard engines in these servers examine mode. Just to keep the record straight: Right now I'm not particularly focused on anyone using it. Its just my personal interface. And though it loads chess engine its not a full fledged engine manager like winboard and arena and may never be.

The problem is I only have one set of chess pieces. I've only figured out how to load transparent gifs. I use java. If I, for example use some winboard pieces, the background color of the image obscures the square color. If i make them transparent gifs, well the black pieces have a black outline and white interior. I eliminate white and i got a hollow piece and the white pieces i eliminate black i got a solid piece.

Any suggestions on where to get pieces to use with a gpl program, either public domain or compatible license. Also any suggestions on if I'm going about this wrong that i need transparent gifs?

Mike
PK
Posts: 905
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: chess pieces used in program

Post by PK »

1) make the outline red
2) change the interior to black
3) change the outline to white
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: chess pieces used in program

Post by stegemma »

Maybe you can try using png with transparent layer, instead of gif files. You can easly add transparent layer to a png file using GIMP. This could works fine.

Another simple solution is to draw any of the 12 pieces (6 per color) with the background for the white/black square. That means having 24 bitmaps instead of 12 but solve the problem... if you don't have customizable chessboard.
wgarvin
Posts: 838
Joined: Thu Jul 05, 2007 5:03 pm
Location: British Columbia, Canada

Re: chess pieces used in program

Post by wgarvin »

You might also want to take a look at this (loading two opaque JPG images and creating a transparent image from them at runtime):
http://www.andromeda.com/people/ddyer/j ... arent.html
User avatar
jshriver
Posts: 1356
Joined: Wed Mar 08, 2006 9:41 pm
Location: Morgantown, WV, USA

Re: chess pieces used in program

Post by jshriver »

Not sure about JAVA but I did write a very minimal UI using C and SDL.

For chess pieces, for chroma keying I just used a neon green as the key color.

Not sure how java does it but if you make the part you want transparent a non-common color it shouldn't cause any problems with cutting or removing from the actual object.

Hope that helps.
-Josh