Package: fenToBoardImage
Aboutfentoboardimage takes a Fen string representing a Chess position, and renders a PIL image of the resulting position.ExamplesExamples can be found under theexamplesfolder in this repository.
Further examples can be found withintests/test.pyYou can customize:the size and color of the boardpiece spritesblack or white perspectiveBoard highlighting for last moveArrowsInstallationInstall the package using pip$ pip install fentoboardimageThen import the fenToImage and loadPiecesFolder functions and use them as follows:from fentoboardimage import fenToImage, loadPiecesFolder

boardImage = fenToImage(
	fen="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1",
	squarelength=100,
	pieceSet=loadPiecesFolder("./pieces"),
	darkColor="#D18B47",
	lightColor="#FFCE9E"
)In order to load a piece set, the pieces must follow this file structure, and must be a .png:-piece_set_name
  -white
    - Knight.png
    - Rook.png
    - Pawn.png
    - Bishop.png
    - Queen.png
    - King.png
  -black
    - Knight.png
    - Rook.png
    - Pawn.png
    - Bishop.png
    - Queen.png
    - King.pngUsageThefenToImagefunction has these parameters:fen:strFen string representing a positionsquarelength:intThe length of one square on the board. Resulting board will be 8 * squarelength longpieceSet:loadPiecesFolderthe piece set, loaded using the `loadPiecesFolder` functionThe loadPiecesFolder function has two parameters:path:strLoads piece set located at the path provided.cache:booleanWhether to internally cache the piece pngs to avoid reloadingdarkColor:strdark square color on the boardlightColor:strlight square color on the boardflipped:booleandefault = FalseWhether to flip to board, and render it from black's perspectiveArrowSet:loadArrowsFolder()the arrow set, loaded using the `loadArrowsFolder` functionThe loadArrowsFolder function has two parameters:path:strLoads arrow set located at the path provided.cache:booleanWhether to internally cache the arrow pngs to avoid reloadingArrows:list[(str,str)]A list of lists containing coordinates to place arrows. In the format
of [start, end] using standard chess notation for the squares.lastMove:dictA dictionary containing the fields `before`, `after`, `darkColor` and `lightColor`. 
`before` and `after` using standard chess notation for the squares, and `darkColor`
and `lightColor` should be hex strings.coordinates:dictA dictionary containing the fields "font", "size", "darkColor", "lightColor", "positionFn",
"padding", and "outsideBoardColor"font:loadFontFile()The font file to use for coordinates, load using the loadFontFile function, with the
file path to the ttf file or bitmap font file as its sole argument.size: intThe font size for the coordinatedarkColor:strThe color of the coordinate for dark squareslightColor:strThe color of the coordinate for light squaresposititionFn:CoordinatePositionFn["outBorder"]|CoordinatePositionFn["innerBorder"]|CoordinatePositionFn["everySquare"]|functionThe function used to determine what characters to draw and where for each square
on the board. Can either be one of the three predefined functions from the
CoordinatePositionFn dict, or a custom function. See the definitions for the
builtin functions in "fentoboardimage/Coordinates.py" for examples to follow when
writing a custom position fn.padding:intThe padding between the square's edge and the resulting placement
of the coordinate characteroutsideBorderColor:stroptionalWhat color to paint the background if the coordinates end up outside the boardDependenciesPillow