Blur Image
A Javascript snippet to blur an image using StackBlur.js
Description
iOS 15: Works (iOS 15.2 beta 3)
This shortcut allows blurring one or more images using StackBlur, an almost-gaussian blur algorithm that was already fast 10 years ago when it was invented.
The default blur radius is 10 (pixels). Add ,radius=N
to the image name to use a radius of N
pixels (up to 255). The shortcut can process images with alpha channel (transparency) without bleeding issues.
I've simplified the original StackBlur code down to less than 4 KB, and the extra code to use it is barely larger than some URLs.
When run without input, the shortcut works as a demo, allowing the user to select one or more files and showing the result of the conversion.
- No error checking
getImageData
documentation at MDN- "Get File of Type" is used instead of "Get Contents of Webpage" to avoid that the user is misleading told that the shortcut uses Safari
Latest Release Notes
1.0.0 - Nov. 21, 2021, 7:26 p.m.
First public version
Feedback
Log in or sign up to leave feedback.
@Davidvb
I’ve made several adjustments to your shortcut:
• Custom Blur Value Prompt.
• Use original filenames
• Adds the blur value to the filename.
• Ability to adjust blurring after preview.
• Added an Actions Menu
• Added synonyms to the Menu
— If you like what I did you can include my tweaks.
https://www.icloud.com/shortcuts/d919010a450745c78a72478aed2fb744
· 7 months, 2 weeks ago
· 7 months, 2 weeks ago
@atnbueno
Member
Author
Thanks for your feedback. As mentioned in the description, this shortcut is designed to work as a function: call it with images from another shortcut and it will silently return the blurred images.
If you want to keep that functionality, you can't have anything interactive when the shortcut input is not empty. Same with the output.
But hey, this is automation, and the nice thing about shortcuts it that we can make them our own :-)
Unsolicited advice ;-) Use a loop instead of recursion.
· 7 months, 2 weeks ago
· 7 months, 2 weeks ago