DOCTYPE html html lang en head meta charset UTF 8 title Canvas with Python Symbols title head body canvas id symbolCanvas width 2048 height 256 canvas button id downloadBtn Download as JPG button script const canvas document getElementById symbolCanvas const ctx canvas getContext 2d function getRandomInt min max return Math floor Math random max min 1 min const symbols _ function getRandomSymbol return symbols getRandomInt 0 symbols length 1 function clearCanvas ctx fillStyle FFFFFF ctx fillRect 0 0 canvas width canvas height clearCanvas for let i 0 i 600 i const symbol getRandomSymbol const fontSize getRandomInt 10 100 const angle getRandomInt 0 360 Math PI 180 const x getRandomInt 0 canvas width const y getRandomInt 0 canvas height const color hsl getRandomInt 0 360 100 50 ctx font fontSize px Segoe UI Symbol Arial Unicode MS sans serif ctx fillStyle color ctx save ctx translate x y ctx rotate angle ctx fillText symbol 0 0 ctx restore document getElementById downloadBtn addEventListener click const link document createElement a link href canvas toDataURL image jpeg link download canvas symbols jpg link click script body html
width canvas height clearCanvas for let i 0 i 600 i const symbol getRandomSymbol const fontSize getRandomInt 10 100 const angle getRandomInt 0 360 Math PI 180 const x getRandomInt 0 canvas width const y getRandomInt 0 canvas height const color hsl getRandomInt 0 360 100 50 ctx font fontSize px Segoe UI Symbol Arial Unicode MS sans serif ctx fillStyle color ctx save ctx translate x y ctx rotate angle ctx fillText symbol 0 0 ctx restore document getElementById downloadBtn addEventListener click const link document createElement a link href canvas toDataURL image jpeg link download canvas symbols jpg link click script body html