frostoven / Squoosh-with-CLI

Fork of Google's Squoosh, but with the CLI retained
https://squoosh.frostoven.com
Apache License 2.0
40 stars 3 forks source link

feature request: Support STDIN / STDOUT workflow. #10

Open markstos opened 1 week ago

markstos commented 1 week ago

I would like to create a Linux/wayland workflow where I take a screenshot, annotate, optimize it, copy it and paste it into my blog... all without any temp file being left on my local hard disk.

The rest of the pipeline has been solved:

Describe the solution you'd like

  1. If input filename passed is -, read file from STDIN a. This may require using a default output file name if --stdout is not used, as none is provided.
  2. If --stdout is passed and there is more than one input file, throw an error.
  3. If --stdout is provided and there is one input file, print resulting file to STDOUT instead of a file.

Does other service/app have this feature?

It's possible to use ImageMagick/GraphicsMagic to do file type conversions and then other format-specific tools to do optimizations, but Squoosh seems to the best and can usefully convert formats and optimize in one step.

aggregate1166877 commented 6 days ago

I think this is a great idea and can see it bringing a lot of value to my own projects as well.

Currently, I'm at my time budget limit because I have contract work that needs to be completed by the end of December, so I won't be able to look at this myself for a while. If someone else wants to give it a shot, I'd be happy to review and test it. Otherwise, I'll get to it when I need a break from my other work.