static async fromBlob(blob) {
        if (IS_BROWSER_OR_WEBWORKER) {
            // Running in environment with canvas
            const img = await loadImageFunction(blob);

            const ctx = createCanvasFunction(img.width, img.height).getContext('2d');

            // Draw image to context
            ctx.drawImage(img, 0, 0);

            return new this(ctx.getImageData(0, 0, img.width, img.height).data, img.width, img.height, 4);

        } else {
            // Use sharp.js to read (and possible resize) the image.
            const img = sharp(await blob.arrayBuffer());

            return await loadImageFunction(img);
        }
    }
Helper method to create a new Image from a blob.
@param {Blob} blob The blob to read the image from.
@returns {Promise<RawImage>} The image object.