async save(path) {

        if (IS_BROWSER_OR_WEBWORKER) {
            if (apis.IS_WEBWORKER_ENV) {
                throw new Error('Unable to save an image from a Web Worker.')
            }

            const extension = path.split('.').pop().toLowerCase();
            const mime = CONTENT_TYPE_MAP.get(extension) ?? 'image/png';

            // Convert image to Blob
            const blob = await this.toBlob(mime);

            saveBlob(path, blob)

        } else if (!apis.IS_FS_AVAILABLE) {
            throw new Error('Unable to save the image because filesystem is disabled in this environment.')

        } else {
            const img = this.toSharp();
            return await img.toFile(path);
        }
    }
Save the image to the given path.
@param {string} path The path to save the image to.