@@ -37,6 +37,7 @@ Table of contents
3737 * [ Base64 saving] ( #base64-saving )
3838 * [ Binary saving] ( #binary-saving )
3939 * [ Saving to WYSIWYG] ( #saving-to-wysiwyg )
40+ * [ Format and quality] ( #format-and-quality )
4041 * [ Development] ( #development )
4142 * [ Building painterro] ( #building-painterro )
4243 * [ Dev-server] ( #dev-server )
@@ -194,7 +195,7 @@ var ptro = Painterro({
194195 xhr .open (" POST" , " http://127.0.0.1:5000/save-as-base64/" );
195196 xhr .setRequestHeader (" Content-Type" , " application/json" );
196197 xhr .send (JSON .stringify ({
197- image: image .asDataURL (' image/png ' )
198+ image: image .asDataURL ()
198199 }));
199200 xhr .onload = function (e ) {
200201 // after saving is done, call done callback
@@ -266,6 +267,16 @@ You can just insert image as data urlto any WYSIWYG editor, e.g. TinyMCE. Image
266267 })
267268```
268269
270+ Format and quality
271+ ------------------
272+
273+ When you call ` image.asDataURL() ` or ` image.asBlob() ` , you can also specify image format, e.g.
274+ ` image.asDataURL('image/jpeg') ` . Default format is ` 'image/png' ` .
275+ If type is ` image/jpeg ` or ` image/webp ` , you can also define image quality from ` 0.0 ` to ` 1.0 ` , default is ` 0.92 ` ,
276+ example: ` image.asDataURL('image/jpeg', 0.5) `
277+
278+
279+
269280Development
270281===========
271282
0 commit comments