chessboardjs icon indicating copy to clipboard operation
chessboardjs copied to clipboard

Export board to an image (png or jpeg)

Open slolo2000 opened this issue 4 years ago • 2 comments

Hello,

Do you think it could be useful to have a method to export chess board to an image (png or jpeg) ?

I think it should be quite easy to do with a 'canvas" and its "toDataURL" method.

Let me know if you would be interested and if you think it could be add to the main repo and I will try to do it.

Thanks in advance for your answer and have a nice day.

slolo2000 avatar Jun 13 '21 10:06 slolo2000

Hi slolo2000,

I am currently working on something for private purposes, I would like to enter chess problems and then export them as graphics. My project isn't quite finished, but have a look at html2canvas, the script can render div tags of a web page in PNG graphics.

https://html2canvas.hertzen.com/

greets, hc

hcgreier avatar Oct 02 '22 21:10 hcgreier

Hi slolo2000,

you can also look for "DOM to Image" repository: https://github.com/tsayen/dom-to-image

This can also export JPG files. greets, hc

hcgreier avatar Oct 08 '22 00:10 hcgreier