Is there any way to blur an Image type image in scriptable?

I load an image from url and now I want to blur it as the background of my widget, or extract the main color from it and set it as the background color. I found some library in JavaScript for doing this, such as rgbaster, but that library relies on html canvas to work and there is no such thing in scriptable (or am I missing something?). Any suggestion would be appreciated!

You could use the WebView and put the code of the library in there.You have to encode the image as base64 to transfer it from Scriptable to the WebView and the resulting image back to Scriptable.

1 Like

Thanks! I’ve already made it works with webview method. Actually it’s okay to pass the raw jpeg data and parse it with Data.fromJPEG() method. Base64 is not always needed.

Can you please send me your code? I also have this problem and don’t see how WebView can help me with this task.