const { imageHelpers } = window.canva;
const canva = window.canva.init();
canva.onReady(async (opts) => {
// Convert a CanvaElement into a CanvaImageBlob
const image = await imageHelpers.fromElement(opts.element);
// Get the size of the CanvaImageBlob
const size = await imageHelpers.getSize(image);
// Do something with the result