MFEN

This is my fancy FEN rendering script that will turn any FEN string into an image that represents the state of a chess board.
This script’s code is released under the MIT license to feed your curiosity, so feel free to grab the code and start happily hacking away (make sure you get these, too). The code is structured as a class (and currently only works on PHP 5) and allows for bulk image generation as well. If you have feature suggestions or code contributions, don’t be shy; send me an e-mail and I’ll get back to you. Want to use the script? Go right ahead and do so; you don’t need my permission.
Want to incorporate this script into some other PHP program you’re making? Using it is very easy. Here’s an example which generates an image of the start position:
include('mfen.php');
$fen = 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1';
$board = new MFEN($fen);
$board->render();
$board->output('chess.png');
$board->destroy();
This will generate an image called chess.png which contains the starting position of a regular chess game. You can send the image directly to the browser by not passing an argument to the output() method.
Just need a single image? Generate one with the example below:
Position: rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1.