AlexanderWillner / imageoptim-alfred-workflow

ImageOptim Alfred Workflow
MIT License
11 stars 1 forks source link

Optimize image in clipboard #4

Open jrobichaud opened 1 year ago

jrobichaud commented 1 year ago

I have a feature request that I believe would be a great improvement.

Another command that takes the image in the clipboard, optimizes it and puts it back to the clipboard.

Use case:

  1. I take screenshot to clipboard using standard macOS shortcut or any other tool allowing to copy an image to the clipboard
  2. I'd like to run optimization through alfred that puts back the result in the clipboard
  3. I could then paste the optimized image using CMD+V (and result accessible to the clipboard history)
AlexanderWillner commented 1 year ago

Interesting idea. For this we would need:

  1. A way to store the clipboard image to a file (need to find some code for this)
  2. Invoke the processes on said file
  3. Move the image file to the clipboard again (e.g. using https://gist.github.com/mwender/49609a18be41b45b2ae4)
  4. Delete the temporary image file
jrobichaud commented 1 year ago

You could consider using the shell commands pbpaste and pbcopy.

AlexanderWillner commented 1 year ago

afaik that's working for text only

jrobichaud commented 1 year ago

@AlexanderWillner, you are totally right, my bad.