cifilter.app icon indicating copy to clipboard operation
cifilter.app copied to clipboard

Support for Siri Shortcuts

Open prolost opened this issue 5 years ago • 6 comments

Would it be possible to create Siri Shortcuts through actions that would allow the various Core Image filters to be applied to images?

The way I imagine this working is that, with the app installed, you could pass an image to a CIFilter.io action that would allow you to select from the various filters and specify the parameter values. The output would be the processed image.

In this way CIFilter.io would turn Siri Shortcuts into a powerful, scriptable image processing engine.

prolost avatar Apr 24 '19 19:04 prolost

I like this idea! I'm not that familiar with Siri Shortcuts but this might be a great time to try them out. @prolost would you have to start with an "Add To Siri" button, or would there be a way for the app to publish 1 "action" per available filter?

noahsark769 avatar Apr 25 '19 22:04 noahsark769

Glad you like the idea! I'm not exactly sure how this all works, but I think you can create one Action that would allow you to choose from the various filters, and configure that action to show the correct parameters for the chosen filter. I've seen that with some first- and third-party Actions.

If you want to learn more, I recommend you take a look at Drafts, Overcast, Bear, and Things for examples of apps with rich Siri actions.

Also this is a great article describing how PCalc uses the system clipboard to get around some limitations with Shortcuts.

I'm thinking this clipboard might be a way for you to pass image data back and forth with Shortcuts. You might be able to pass an image from Shortcuts to CIFilter.io through the action, but I'm getting the sense that to get an image back you may have to put it in the clipboard.

prolost avatar Apr 26 '19 00:04 prolost

This shortcut seems to pass an image as an output, so maybe it's doable in some way - not sure if they're using clipboard hackery or not. Seems pretty viable to export one action for each filter from the CIFilter.io app

noahsark769 avatar May 01 '19 02:05 noahsark769

Hey, sorry for the delay in replying. Yes, Shortcuts can most certainly take images as input and provide them as output. And to build such shortcuts, you use built-in Actions that do the same (Crop, Overlay, Mask, etc.). What I wasn't sure about was whether third parties could create such Actions. Have you had any luck exploring this?

prolost avatar May 15 '19 00:05 prolost

Hi again! I don't know if you've been following the iOS 13 developments WRT Shortcuts, but it looks like Apple has made a big change that should allow what I'm suggesting here to work. The feature is called "Parameters," and it seems to allow 3rd party Actions to take any kind of input and return any kind of output, including images.

https://twitter.com/stroughtonsmith/status/1136316933505265665

https://developer.apple.com/videos/play/wwdc2019/213/

https://thesweetsetup.com/all-the-new-things-in-shortcuts-for-ios-13/

I hope this helps!

prolost avatar Jul 07 '19 22:07 prolost

Yep, I think that's exactly what we'd want here!

noahsark769 avatar Aug 02 '19 20:08 noahsark769