Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
One of the great things about Photoshop's Save for Web is the fact that we have the ability to save out objects that include transparent or semi-transparent portions in them. In this movie, I am going to be walking you through my personal workflow for exporting out something that contains transparency, and explain to you exactly what that means and why I am optimizing it the way I do. So as you can see here, I've got a small web banner that I need to export out which has a slight drop shadow around the outside of it. So what I want to do is I want to be able to showcase this on any background.
Maybe I'm going to be using this for multiple projects where it's going on a light background, a dark background, et cetera. I don't want to have to optimize this multiple times with multiple different background colors. I want to be able to save it out as a semi-transparent object with this blurry drop shadow that can then be applied to any type of background that I want. In order to do that, I need to make sure that I optimize it for transparency by using both the right file format and also cropping it the right way here inside of Photoshop. So in order to get rid of all of the area that I don't need here inside this document, there is actually a really cool little trick that allows you to do this.
The first thing that I am going to do I am simply going to delete the Background layer. Anytime you want to create something with transparency, the easiest thing to do is to throw that background layer away. So I am just going to drag it down to the trashcan and throw it away, just like that. Now as soon as you see the checkerboard, that means that you have transparency behind whatever it is you're working on. Now it's very hard for me to see how far that drop shadow reaches out around the edges of this thing. So if I were to grab the Crop tool and try to make an adjustment to this, it would be very hard unless I zoomed in really, really far to get exactly the amount of pixels that I needed.
So what I am going to do is I am going to hit Escape to get out of that and switch back to the Move tool instead. With the Move tool selected, I'm going to go up to the Image menu, I'm going to choose Trim, and inside of the Trim dialog box, this option right here at the top where I base it on a certain criteria, I am going to base it on transparent pixels. So I am going to say okay, find the transparent pixels in my image and just trip them away. Once I do that, watch what happens to my image. It automatically trims everything that is completely transparent.
Anything that has even the slightest bit of pixel data in it is going to remain uncropped. This makes sure that my drop shadow looks perfect. I maintain the transparency, but I shrink the image down as much as I can. So now, once I had that image trimmed, I can go up to the File menu and choose Save for Web and actually get it out of here. So let's go to File > Save for Web. Once I am inside the Save for Web dialog box, it's going to pop up and it's probably going to recommend the last setting I used, which happens to be a JPEG on a medium setting.
Now this is a great example of why JPEGs are bad, both for transparency and for flat-color objects. You'll notice here that I get this white border around the drop shadow area. That's bad. Also, if I zoom in, see all these little artifacts that are around the text and around the image in this flat color areas? JPEGs don't handle that well. So let me zoom back out. Watch what happens when I switch from JPEG to PNG. You are going to notice two things: my transparency comes back and if I zoom a little bit, all of those artifacts in the flat areas have gone away. So, PNG, awesome for this type of graphic. It's also the best when supporting transparency.
Now if you want turn the transparency off in this, which I don't know why you would, but if you do, you can click this box here and it goes away. You'll notice that when I turn Transparency off the file size shrinks just a little bit. Turning it back on adds a couple of K. I'm okay with that. That's no big deal to me. Now once I do that, I can change the size of it. Right now it's 260 x 260. I can change it if I want to. I don't have to. And when I'm ready, I hit Save. Once I hit Save, this dialog box pops up.
I am just going to save it to my desktop, and I'll call it transparent_bot.png and I will hit Save. Once I do that, I can then open it up by hitting Command+O or Ctrl+O. Once I open it up, you can see it's just one single layer inside of here. layer 0, and if I create a new document--I will just do 1024 x 768; that's fine-- I can fill this with any color I want. So I will fill it with a really wacky color like pink and then I'll drag this over and drop it in.
You can see that it looks like it's just floating there. And it doesn't matter if I select the background and change the background color. I can change this to whatever color I want. And because I saved this out as a transparent PNG, the drop shadow looks perfect every time; the edges are nice, clean, and crisp; and I have no artifacts in the middle of those flat-color areas. So, the next time you go to optimize out a transparent graphic, whether it would be a button, an ad banner, or even a logo, try using the PNG file format and making sure that you use that Image Trim command so that you get a nice tight fit around it while still maintaining all of your transparency areas.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.