1

I'm not entirely clear on how the screenshot + pasteboard handling on macOS works. For example, as a user I perceive that when I press <shift-control-cmd-4> I can select a region of my screen and capture this screenshot into the pasteboard. I then can simply <cmd-v> (paste) this into many applications. Fore example, if I paste this into most chat applications (Messages, MatterMost, Discord, etc.) it shows up as a PNG file that is then uploaded to the hosting service.

Is there a way method to capture a pasteboard image and then send this to an optimizer (something like ImageOptim that generally get's between 15-25% additional lossless compression out of most screenshots) that can then put this back into the pasteboard for pasting it on into an app for additional seamless lossless compression?

4
  • If you want to save data size, why not capture as jpg… or do you need the transparency?
    – Tetsujin
    Commented Sep 7, 2019 at 16:31
  • Usually the screenshots I'm dealing with are such that a PNG yields better compression since they are limited in colors (ie, not photos or complex images). I also need to maintain pristine quality 90% of the time.
    – ylluminate
    Commented Sep 7, 2019 at 16:37
  • Now have said that @Tetsujin, I am willing to use JPEG2000 as I think that would be the best of both worlds, but so far when I change the default macOS screenshot capture type to that, it seems that apps still paste as PNG files...
    – ylluminate
    Commented Sep 7, 2019 at 16:43
  • tbh, I'm just speculating, I've never actually tried it. Wasn't even sure it would do jpeg2000
    – Tetsujin
    Commented Sep 7, 2019 at 17:12

1 Answer 1

1

I don't want to take the time now to actually do it, so I'll just point you in the directions I would take. If better answers become available, we can just delete this one :-)

There are two region capturing methods native to the Mac, one saves the file (Desktop by default, but can be anywhere) and one just puts it in your clipboard (some temp file somewhere most likely). You can change the shortcuts, file type and more... some through Preferences, some (file type) through command line in Terminal.

For example, swith the file format with defaults write com.apple.screencapture type jpg...

To process a region snap and get it back into clipboard:

  1. You can do this with Alfred. You may need to save the file instead of just using the clipboard. (AUtomatically Save it to disc, process with compression of your choice (there's even imageoptim Alfred workflow) and put it back into your clipboard with some notification that it's done.) You could start with these Workflows probably and modify them...

  2. You can do the same thing with Keyboard Maestro if that's more of your jam.

  3. You may be able to do it with Automator, but I'm not sure about that.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .