diff --git a/README.md b/README.md index a18a2a8b..fb584650 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,8 @@ htmlToImage ``` #### toBlob -Get a PNG image blob and download it (using [FileSaver](https://github.com/eligrey/FileSaver.js)): +Get an image blob and download it (using [FileSaver](https://github.com/eligrey/FileSaver.js)): +Defaults to a PNG blob, but can also export other image types by passing an options object `toBlob(div, { type : 'image/jpg' })` ```js htmlToImage diff --git a/src/index.ts b/src/index.ts index 2de59a30..287b91d9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -89,7 +89,7 @@ export async function toBlob( options: Options = {}, ): Promise { const canvas = await toCanvas(node, options) - const blob = await canvasToBlob(canvas) + const blob = await canvasToBlob(canvas, options) return blob }