jcsalterego / pngpaste

Paste PNG into files, much like pbpaste does for text.
Other
458 stars 32 forks source link

pngcopy #10

Closed ZGainsforth closed 1 year ago

ZGainsforth commented 7 years ago

Now if only I could do this:

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

jcsalterego commented 7 years ago

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?

ZGainsforth commented 7 years ago

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 notifications@github.com 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.

jcsalterego commented 7 years ago

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.

ZGainsforth commented 7 years ago

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. ;-)

jcsalterego commented 7 years ago

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

Ahh, nice.

gibfahn commented 5 years ago

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.

jcsalterego commented 5 years ago

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

manueliglesias commented 3 years ago

Just leaving my useless +1 in here 😅

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

jcsalterego commented 1 year ago

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