How to Paste Transparent GIF or PNG Images into Photoshop

When copying and pasting transparent GIF or PNG images from the internet into Photoshop, the transparent areas of the image may be converted into black. The problem is that transparency is not recognized during the copy/paste command, and so, the transparent areas default to black. How can this be avoided?

Incorrectly Pasted

Correctly Pasted

Method 1: Save the image first.
The simplest way to get around this problem is to simply save the image from the web to your hard drive, instead of copying it. Once the actual GIF or PNG image file is on your hard drive, you can easily open the file in Photoshop. The transparency will be recognized, and you can copy/paste within Photoshop into other open files as needed.

Method 2: Manually remove the black.
Another possibility, although more complicated, is to manually delete the black area after pasting from the web. This is not a good idea if your image already has black in it. Go to Select > Color Range, make sure the Select drop down is on “Sampled Colors,” and then use they eyedropper tool to select an area of the color black which you wish to remove. Turn the Fuzziness down to 0, and click OK. Now simply hit the Delete key to remove the selected black area. Be careful! If your original image has any black pixels in it, these will be removed as well, because after the transparency gets converted to black there is no way to tell the difference. Method 1 is guaranteed to keep the original image intact, but it is useful to know all the options!

Solution: Colormap missing during MATLAB figure export to Illustrator

I usually export my MATLAB figures to Adobe Illustrator .AI format. However, I have noticed that if my figure contains a colorbar, the colormap is blank when I open the AI file in Illustrator.

To fix this, I found that you can instead save the figure as an EPS file (*.eps, standing for Encapsulated PostScript). This file can be opened in Illustrator, and still contains all the layer and path information I need.

Another useful trick I use before exporting a figure with colormaps is to increase the step size of the colormap. By default, the colormap contains 64 colors, but you can usually see the edge between each color. To smooth out the colormap, I like to use:

colormap(gray(256))

This tells the colormap to use 256 colors instead of only 64. Of course, the colormap gray can be replaced by any other colormap name, e.g., hsv or jet.