我使用chess-image-generator
图书馆来绘制棋子,但结果质量太差了
var ChessImageGenerator = require("chess-image-generator");
var imageGenerator = new ChessImageGenerator({
size: 720,
light: "rgb(200, 200, 200)",
dark: "#333333",
style: "merida",
});
imageGenerator
.loadFEN(
"r2qk2r/p1p5/bpnbp2p/1N1p1p2/P2P1p1N/2PQ2P1/1P2PPBP/R4RK1 b kq - 1 13"
)
.then((r) => imageGenerator.generatePNG("image.png"));