Is there any way to paste transparent image to photoshop via clipboard?
I tried to use registered “PNG” format, but it seems like photoshop does not support it (opposite to MSOffice 2007 and GIMP). Usage of CF_DIB does not preserve alpha channel in photoshop.
NOTE: I used WinApi to perform such things
4
Answers
You have to save the png or gif image to your computer first, then open it in Photoshop or you’ll get a black background.
After saving, you can also drag it from your computer and drop it into the Photoshop project you’re working on and it will be transparent on a new layer.
When you do this it may turn into a Smart Object, which will maintain its quality on resize. If you don’t want it to be a Smart Object, right click on its layer, choose “Rasterize Layer”.
open your image in Microsoft paint or other software and save as transparent .png file and after drag and drop in photoshop.
So I got fed up with this annoyance and made a workaround.
There are two pieces to it:
The AutoHotKey script checks if Photoshop is currently active, and if so it intercepts the
Ctrl
+V
key combination, and then it runs the utility.If the utility saved an image to
%TEMP%clip.png
, theShift
+Ctrl
+F12
key combination is sent to Photoshop, which I have mapped to a Photoshop Action to place theclip.png
file into the currently open document.If the utility did not save the image, the standard
Ctrl
+V
key combo is sent to Photoshop and a standard paste is performed.All the source code is available here: https://github.com/SilverEzhik/ClipboardToPNG, and the utility can be downloaded here: https://github.com/SilverEzhik/ClipboardToPNG/releases
To create the Photoshop Action, just make a new action with the key combination mapped to Shift+Ctrl+F12 (or change the combination in the script file), and then while recording, go to
File
>Place Embedded...
, and paste%TEMP%clip.png
in the file name field.The source code for the AHK script is provided below – if you haven’t used AutoHotKey before, install it, then save the code to a
filename.ahk
file to the same directory as the ClipboardToPNG.exe utility, and then just run it.Unfortunately, Photoshop has yet to assist in the “copy-paste” of pngs from an external source into a page without a black bringing a background. The only way that I know of is to save the file and then open it in Photoshop. From there, a “copy-paste” should work.