46

When I copy a PNG image with transparency to the clipboard and subsequently paste it into Photoshop, Paint, etc. - the transparency turns to black.

Is there any workaround for this? Is this a browser issue, an application issue or an OS issue with the clipboard?

I'm using Windows 7 and tested with the latest versions of Chrome and Internet Explorer.

  • 1
    Please elaborate. What exactly are you copying? The .png file or its bitmap while it is opened in an editor/viewer? If it is the file, then Photoshop (should) be able to open the file correctly, transparency and all. If it is the picture’s actual pixels, then it depends on the source program and whether it is putting the transparency data in the clipboard or not. – Synetech Jul 7 '12 at 20:34
  • Sort of depends on OS. Clipboard seems to be unable to contain semitransparent images, but some browsers keep the image link instead - this, when pasted, has transparency unaltered. – Tomáš Zato Dec 1 '14 at 10:40
  • If you open a .png file with transparency in MS Paint (Windows 10) or Firefox 60.0.2 the background is displayed as white. If you open the same file in IrfanView or Chrome 67.0.3396.87 the background is displayed as black. If you open the same file in Paint.NET, the background is displayed as a grey-and-white checkerboard. If you open it with Paint 3D the background is displayed as beige. If you copy from MS Paint, the background becomes opaque white. If you copy from Paint.NET the transparent background IS preserved in Win10 clipboard, so what happens depends on what program you paste it to. – Dave Burton Jul 6 '18 at 10:09
30

Copy-Paste doesn't maintain transparency. Try saving file and then use Open File in Photoshop. AFAIK, Paint doesn't have the ability to save transparency enabled png files.

  • 4
    Yeah, this is what I do. I just hoped there was some other way around it. – Ryan Elkins Feb 1 '11 at 22:20
  • 2
    @ryan FWIW, this actually seems to be a bug on the Photoshop side. It works in Paint.net, when copied from IE, FF, or Chrome. I thought maybe a workaround would be "Paste in Paint.net, select all, copy, paste in Photoshop", but that doesn't work--you get the image on white instead of black, but still with no transparency. – Kip Nov 25 '11 at 19:29
  • 9
    Just a note; you can open the URL in Photoshop, saving you the intermediate step; Windows (I'm sure other OSes will do the same) will download it to a local temporary file, and open. This (I've just observed) retains transparency. – Dan Lugg Apr 3 '12 at 19:38
  • > Copy-Paste doesn't maintain transparency. That depends on the source of the clipboard data. – Synetech Jul 7 '12 at 20:33
  • If pasted on PowerPoint/Word, the transparencey will be kept. – Xiao Peng - ZenUML.com Aug 29 '14 at 4:35
11

Posting the comment by @DanLugg as an answer, as it is the most convenient for Windows, IMHO:

  1. Right-click on the image and Copy Image URL from the browser.
  2. In Photoshop choose File->Open (ctrl-o) and paste the URL into the filename portion of the dialog.
    • Photoshop/Windows will download the URL to a temporary file and open it.

For OS X, there is no field in an Open File Dialog/Sheet where one could paste a URI. Instead, you must download the file and open it (e.g. drag from browser to Desktop, then drag the new file onto the Dock or into your Photoshop document) and then delete the temporary file.


FWIW, this appears to be a Photoshop problem, not a browser or OS problem. On both OS X and Windows, I can copy a PNG image with transparency from Chrome (and also Safari on OS X) and paste it into Illustrator or other applications and have it maintain transparency. Photoshop alone is to blame.

  • This is genius, had no idea Photoshop could open straight from a URL! Good finding! – Doggie52 Feb 20 '17 at 15:30
  • 1
    This option does not seem to be available for OSX. Anyone knows? – Christine Cooper Oct 4 '17 at 14:16
  • @ChristineCooper Best option I know for OS X is to download the image, then open, then delete original. It's as "easy" as dragging the image to a folder or Desktop (which saves as a file), then dragging that file onto Photoshop in the Dock, or into an open Photoshop document. I've tested a variety of options using both Chrome and Safari along with Photoshop CS6, and I cannot find any better way, or any way using the clipboard. – Phrogz Oct 4 '17 at 14:35
  • Yes, I am trying to avoid the download and open option and want to essentially reduce the steps. Drag and drop doesn't work either. Hopefully, OSX users will be able to paste URLs into Photoshop in the future. Thanks! – Christine Cooper Oct 4 '17 at 15:02
  • It's not a Photoshop problem. The issue is that the clipboard format used by whatever copies it isn't actually specced as alpha-capable. Photoshop is just following the specs correctly. – Nyerguds Feb 6 at 10:31
2

Try this: copy the transparent image, paste into MS Word. THEN copy it (or drag/drop) from word and paste it to the other target program.

I found a paste into Visio from Chrome turns black, but works properly in Word, and then copied from Word it pastes properly and transparently into Visio.

  • don't do it! You lose the transparent background! – Andrei Krasutski Aug 29 '17 at 19:29
  • Not sure why you are telling me to not do it, it is what I do to preserve the transparency when using Visio. I also use Word to add transparency (set background color and / or Remove Background features) when it was not an image with transparency. – JamieRI Feb 3 '18 at 20:16
1

I made a workaround that addresses the issue. Running my script after copying a PNG allows you to paste an image from Chrome into Photoshop, Paint, etc with the transparency in tact.

Program + Source: https://github.com/skoshy/CopyTransparentImages/releases

If you run into any issues with it, feel free to let me know here or on Github!

  • I'd be interested in the details on this. What does your code do? What is Photoshop expecting for transparency that is not in the clipboard data? – Phrogz Oct 4 '17 at 14:49
0

You can just drag the image from the browser to Photoshop or whatever program that will properly handle a PNG file.

  • 1
    Sounds like a good suggestion, but this does not work between Chrome and Photoshop CC on Windows 7x64. The [+] cursor shows up on the Photoshop target, but no image is opened as a result. – Phrogz Nov 13 '14 at 16:47
0

I just spent a lot of time looking into this. I've used Photoshop to copy semi-transparent textures for some time while prototyping (with the destination of Axure RP).

Now, I've tried using the new clipboard API in html 5. I dissected the PNG files that are generated by this process.

If I use the clipboard (with a rectangular marquee) to copy a semi-transparent texture to the browser with the clipboard API, it sets the alpha byte to FF (completely opaque).

If I use the drag and drop API to copy a "Save as Web" PNG 24 file to the browser, it works as expected and transparent pixels work (and the alpha byte is not forced to FF).

Note: Even thought Photoshop says it's 24 bit, it actually exports it as 8 bit still (confirmed).

0

For anyone wondering, if you get a black background color on a copied PNG file even when opening it manually, try checking if there isn't an alpha channel.

Seems like depending on which software was used to make the PNG, the transparency is sometimes kept as it inside the layers, but some other time, it's kept in an alpha channel.

A trick when it's in the alpha channel is simply to CTRL+Click on the alpha channel's small preview to select it and then create a mask on the layer with the black background from the selection. (Then you can delete the alpha channel)

0

So I got fed up with this annoyance and made a workaround.

There are two pieces to it:

  • A tiny utility I wrote to save the clipboard image to a .png file
  • An AutoHotKey script

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, the Shift+Ctrl+F12 key combination is sent to Photoshop, which I have mapped to a Photoshop Action to place the clip.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.

DoPhotoshopPaste() {
    RunWait, %A_ScriptDir%\ClipboardToPNG.exe ; run utility, wait for it to complete
    if (ErrorLevel == 0) { ; if error code is 0
        SendEvent, +^{F12} ; press Shift+Ctrl+F12 to run the designated Photoshop action to paste
    }
    else { 
        SendEvent, ^v ; else, just perform a standard paste.
    }
}

#IfWinActive ahk_exe Photoshop.exe ; only activate this hotkey when photoshop is active
    ^v::DoPhotoshopPaste()
#IfWinActive

protected by Community Jan 28 '16 at 0:12

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.