Images of pieces

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Images of pieces

Post by Henk »

How do they get these images/icons for (chess) pieces and (chess) board. Do they draw them with Paint or what software do they use. So do we need to be an artist to create an acceptable user interface.

Drawing a square should be possible for everyone but that's not enough.
tpetzke
Posts: 686
Joined: Thu Mar 03, 2011 4:57 pm
Location: Germany

Re: Images of pieces

Post by tpetzke »

You can use a related true type font, eg. this one

http://www.enpassant.dk/chess/fontimg/alpha.htm

I just spent some time on a GUI prototype with this approach, it does not look to bad.

http://macechess.blogspot.de/2014/08/le ... mming.html

Thomas...
Thomas...

=======
http://macechess.blogspot.com - iCE Chess Engine
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Images of pieces

Post by hgm »

I designed the bitmaps for WinBoard's built-in unorthodox pieces using MS Paint. WinBoard originally (i.e. since Winboard_x) used true-type fonts for user-supplied piece images, however. Therefore I did design a font for playing Ultima using the TypeLight font editor on Windows:

Image

The WinBoard bitmaps were later converted to SVG graphics by Arun Persaud for use with XBoard (after we switched to the Cairo plot library for that). I think he used Inkscape to do this. I later added some new pieces by editing the original ones (if they were minor alterations, to indicate non-promotability in Chu Shogi; e.g. a non-promotable Bishop is just a Bishop without a cross inscribed on the mitre), or drawing completely new ones by first loading a photograph, drawing over it, and then deleting the photograph (e.g. the Lion, Tiger, Leopard and the Dolphin).

Image
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Images of pieces

Post by Henk »

I also tried to use Paint to draw some images a few years ago. I can't show the result for my website only runs local on my own machine.

My images look clumsy. I also encountered the problem of making them transparent. I read somewhere that you can't do that with Paint.

First thing to not forget is that all icons should have same start offset on the y-axis. That even does not hold for my images.
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Images of pieces

Post by Henk »

hgm wrote:I designed the bitmaps for WinBoard's built-in unorthodox pieces using MS Paint. WinBoard originally (i.e. since Winboard_x) used true-type fonts for user-supplied piece images, however. Therefore I did design a font for playing Ultima using the TypeLight font editor on Windows:

Image

The WinBoard bitmaps were later converted to SVG graphics by Arun Persaud for use with XBoard (after we switched to the Cairo plot library for that). I think he used Inkscape to do this. I later added some new pieces by editing the original ones (if they were minor alterations, to indicate non-promotability in Chu Shogi; e.g. a non-promotable Bishop is just a Bishop without a cross inscribed on the mitre), or drawing completely new ones by first loading a photograph, drawing over it, and then deleting the photograph (e.g. the Lion, Tiger, Leopard and the Dolphin).

Image
Second board of images looks acceptable to me. Chess figures look like standard ones, that's ok.
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Images of pieces

Post by Henk »

tpetzke wrote:You can use a related true type font, eg. this one

http://www.enpassant.dk/chess/fontimg/alpha.htm

I just spent some time on a GUI prototype with this approach, it does not look to bad.

http://macechess.blogspot.de/2014/08/le ... mming.html

Thomas...
Ok cold as ice. Because of blue and bright white I guess. Images are ok.
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: Images of pieces

Post by Henk »

Henk wrote:I also tried to use Paint to draw some images a few years ago. I can't show the result for my website only runs local on my own machine.

My images look clumsy. I also encountered the problem of making them transparent. I read somewhere that you can't do that with Paint.

First thing to not forget is that all icons should have same start offset on the y-axis. That even does not hold for my images.
I mean making the background transparent. Background is different for white and black squares.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: Images of pieces

Post by stegemma »

Henk wrote:I also tried to use Paint to draw some images a few years ago. I can't show the result for my website only runs local on my own machine.

My images look clumsy. I also encountered the problem of making them transparent. I read somewhere that you can't do that with Paint.

First thing to not forget is that all icons should have same start offset on the y-axis. That even does not hold for my images.
If you use GIMP, it is easy to have transparent icons and a lot of effects (for free).
mar
Posts: 2555
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: Images of pieces

Post by mar »

Well you can try Inkscape to create vector art.
Wrote binary polygon rasterizer with sub-pixel accuracy and arbitrary number of contrours (including holes), tesselating bezier curves is trivial.
So you simply rasterize a binary image, then generate signed distance field and downsample the resulting image to something like 64x64 or 128x128 per piece.
You can then use the hardware to do upscaling for you (using a simple alpha test on ancient hardware will do as long as you keep bilinear filtering enabled)
and it will look like vectors, dirt cheap and efficient.
You can do better than that on hw that supports programmable fragment shaders, for example to render nice outlines.
Or you can do it manually in software if you prefer caching.
Only problem is anti-aliasing so either multi-sampling or post-processing.
But you can always cache the pieces for the required scale.
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Images of pieces

Post by jdart »

In my experience handling internal color in fonts and rendering them well against a colored background is not so easy. Can you share anything about how you did this?

--Jon