pngpaste icon indicating copy to clipboard operation
pngpaste copied to clipboard

pngcopy

Open ZGainsforth opened this issue 8 years ago • 8 comments

Now if only I could do this:

pngpaste - | convert - -resize 50% - | pngcopy

ZGainsforth avatar Feb 07 '17 00:02 ZGainsforth

Interesting idea; what is your actual use case for copying a PNG, resizing it and copying it back into the clipboard? Where does it end up?

jcsalterego avatar Feb 07 '17 00:02 jcsalterego

I am grabbing screen captures on a retina display. Sometimes but not always, I want the resolution halved, and I do this a lot so I don’t want to screen cap to a file, and have to worry about cleaning up trash. One simple solution is to make a simple terminal command which allows me to down sample the clipboard.

like this:

[Cmd-shift-4-space] to copy a window to the pasteboard run terminal command [Cmd-v] pastes the down sampled image in keynote (usually).

On Feb 6, 2017, at 4:28 PM, Jerry Chen [email protected] wrote:

Interesting idea; what is your actual use case for copying a PNG, resizing it and copying it back into the clipboard? Where does it end up?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jcsalterego/pngpaste/issues/10#issuecomment-277860033, or mute the thread https://github.com/notifications/unsubscribe-auth/AGi-6xWkQqHXYyrJVHfGjFrYkfTo1GZPks5rZ7qagaJpZM4L45a4.

ZGainsforth avatar Feb 07 '17 00:02 ZGainsforth

This does make me wonder if there's something buried in the OS X API that allows for saving different resolutions. Otherwise, pngcopy would be a whole new thing and expand the scope of pngpaste considerably.

jcsalterego avatar Mar 27 '17 09:03 jcsalterego

Incidentally, I've been doing the following in iTerm2:

pngpaste - | convert - -interpolate nearest -filter point -sample 50% - | imgcat

And then I just copy the image out of the terminal. But it would be nice to replace that last command with pngcopy. ;-)

ZGainsforth avatar May 25 '17 19:05 ZGainsforth

pngpaste - | convert - -interpolate nearest -filter point -sample 50% - | imgcat

Ahh, nice.

jcsalterego avatar May 25 '17 19:05 jcsalterego

Otherwise, pngcopy would be a whole new thing and expand the scope of pngpaste considerably.

Looks like someone has raised a PR for it! https://github.com/jcsalterego/pngpaste/pull/15

Assuming it works, it'd be great to have this, for me at least it makes sense to have pngcopy and pngpaste to match pbcopy and pbpaste.

gibfahn avatar Oct 15 '18 15:10 gibfahn

Thanks - I need to revisit things here and merge all the good code and ideas people have contributed.

jcsalterego avatar Oct 15 '18 15:10 jcsalterego

Just leaving my useless +1 in here 😅

I would love to see #15 merged and eventually make its way to brew

manueliglesias avatar May 17 '21 01:05 manueliglesias

Sorry all, #15 has been closed and I've recommended the author make pngutils and fork pngpaste.

jcsalterego avatar Feb 08 '23 18:02 jcsalterego