domtoimage resolution code example
Example: dom-to-image bad quality
const scale = 2;
const image = await toPng(elm, {
height: elm.offsetHeight * scale,
style: {
transform: `scale(${scale}) translate(${elm.offsetWidth / 2 / scale}px, ${elm.offsetHeight / 2 / scale}px)`
},
width: elm.offsetWidth * scale
});