Output to Clipboard with Transparency?

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderator: xnview

beornlake
Posts: 12
Joined: Thu Aug 23, 2018 2:43 am

Output to Clipboard with Transparency?

Post by beornlake »

Is there any way to process an image and set transparency while using the Clipboard as the output (rather than PNG/GIF)?

For example, the following should read the Clipboard, process it to black-and-white, autocrop white pixels, set all the remaining white pixels to transparent, and then put the result back onto the Clipboard:

Code: Select all

nconvert.exe -clipboard -binary nodither -autocrop 0 255 255 255 -truecolors -set_alpha -transpcolor 255 255 255 -out clipboard
But this doesn't seem to work. My current workflow is to save a temporary PNG (same command as above, but using '-out png -o temp.png'), then copy the PNG to my clipboard outside of nconvert, and delete the temp file when I'm done. It works, but isn't ideal. Being able to dump the PNG data straight onto the Clipboard would be amazing!
cday
XnThusiast
Posts: 4615
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Output to Clipboard with Transparency?

Post by cday »

Input file(s) must be the last (right-most) term...
beornlake
Posts: 12
Joined: Thu Aug 23, 2018 2:43 am

Re: Output to Clipboard with Transparency?

Post by beornlake »

When working with the Clipboard, it behaves a little differently. There isn't an "input file" per-se, so the -clipboard flag just lives with the rest of the options. (I just confirmed this; putting the -clipboard directive at the end didn't change the behavior).