Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Regardless of whether you create pixel- precise mockups or just sort of sketch your layouts on Post-it notes, at some point you're going to need to create the image assets for your site. Now because of the image requirements of your site will change based on multiple factors, you need to take just as much care in planning and creating image assets for your pages as you do with any other part of the process. Now to illustrate this, I'm going to return to the desolve.org.mockup. And remember, you can find that, if you go in the exercise files, you can find that directly in the Assets folder.
And I'm going to use this to give you some examples of things that you're going to need to consider when creating image assets for your sites. Now if you don't have Illustrator installed, you can open up the PDF file of the same file that I've included in there as well. But you don't really have to open it up. We're not really doing anything here. We're not going to be exporting out any graphics. This is more a discussion of the decision-making process that I use when deciding how to deal with images within my site, and what type of images I'm going to be creating. Okay, so again, I'm just going to start at the top and talk about some of the factors involved in planning image assets for my site.
Now the first thing that I'm faced with is the Desolve logo right here. You can see it's a separate graphic, but it has the text right next to it with a tagline. And one of the things that I need to start thinking of is is this entire logo going to be an image, or can I create this typographically in CSS. Now a few years ago that wouldn't have even been a question. This is a font called Cantarell that isn't a default system font, so it was something that I would not have been able to do, but with the advent of web fonts, I'm now able to take fonts like this and use them in my web site and not have to rely so much on images.
So in this case I'm thinking that the background of the header element can certainly be handled through CSS, just assigning a color to it, and I could probably just export the logo out as a transparent PNG file and then use CSS to go ahead and style the text so that I don't have to rely on an image there and do any really complex CSS where I am hiding text and showing an image, that sort of thing. Now the next thing I have to decide are these icons, what I'm going to do, or how I'm going to treat these icons. These are all little icons that I've created in Illustrator so I've got a little camera, some word balloons there, a bag. And obviously I'm probably going to use those as background images.
But do I really need to go ahead and export out four separate icons, or is there a way that I can sort of combine these? One of the things that I'm always thinking about when I create image assets is how to create the most efficient set of assets for my site as possible. I want to make as few requests to the server so that if the site is being viewed on mobile devices, for example, that it's a little bit more responsive and it's a little bit snappier. Well, one of the things that I can do through CSS is I could combine all of those icons into a single file, and then as I show those icons as background graphics, I can just sort of move to a new location for each of those images.
That's a technique called CSS sprites that I've talked about before in a couple of my titles, and it works really, really well. Now before I went into creating my CSS sprites file for those icons, there were a few things that I had to think of. For example, you can see right down here in the Galleries, we have a larger version of that icon, and that's actually going to be consistent throughout the site. You go to the Contact page, for example, this icon is going to show up here in a much larger fashion. When I go to GEAR, that's going to show up in a much larger fashion. So do I go ahead and create sprites that are much larger and then just scale them down in the navigation? That's certainly an option.
But one of the things that we continually have to think about now as web designers is what happens when the site is viewed on a mobile device? And scaling images up or down actually impacts the performance of lot of sites on phones and things like that. So basically, I really just did a compromise. I created two sets of sprites, and I want to show those to you. These are also in the Assets folder. And we have the icon sprites 25, which is a 25x25-pixel icon, and then we have the icon sprites 50, which is a 50xS0. So I use the 50 sprites for the larger one. I use the 25 sprites for the smaller one.
Yes, it's one more request, but I've eliminated scalings. So these are all things that you have to think about, in terms of how are my graphics going to impact the performance of my site? Okay, now obviously I did not create these images here in Illustrator. The photograph of the New York City skyline, the Philadelphia photograph, the Chicago photograph, those are all the images that I imported in from Photoshop. Now the thing that I have to think about with those images, however, in time I've got these photos or any raster-based images, are they going to be represented through the use of an image tag, or am I going to use background graphics to show them? This is an extremely personal choice the designers make.
A lot of people use image tags for everything. Some people try to use almost no image tags if possible. I have a very easy litmus test for whether this is going to be a separate image using an image tag or whether it's going to be a background graphic of a structural element, and it's simply this: Would that image need to be described to an assistive device? And what I mean by that is if somebody is browsing this site on a screen reader, with the site's content to be impacted negatively if that image wasn't described or if that image wasn't there? In that case I look at an image and I say, okay, is this image purely decorative in nature? Yes, this is purely decorative in nature.
And so because of that, I'm going to use a background image for that. Same question gets put to these guys: Is that purely decorative in nature? And so you go throughout the site and you think about that. Is this something that's going to be a background image or is this something that's going to be foreground image that I'm going to use with the image tag? And that's typically how I decide it, but again, it is an incredibly personal choice. Now another thing that you need to think about when you're designing graphics for your site is, what can I handle through CSS, and what am I going to need an image to represent, and that is constantly changing, which is one of the reasons why you want to stay up with all the new CSS techniques.
Take, for example, this overlay over here. Again, a few short years ago, I would have had to create this image as a whole with that overlay as part of it and then just sort of position the text over part of the overlay to sort of fake, if you will, that box. But now CSS can handle semi-transparency. It has basically alpha settings that you can put on different color values now, and so that is actually something that we can do through CSS now, and I don't have to worry about generating that image with that overlay already in place. That actually gives me a lot of flexibility, because now it means if I want to create a layout where this particular box conflicts over that image or if it's a flexible layout where the image can get clipped behind it, then I don't have to worry about that box resizing and repositioning.
The same is true of certain icons. For example, if I scroll down and I see this inner button right here, again couple of years ago that is something that we would have to save out as a separate file, or I would have to understand that say a default button from the browser was going represent that. But now through the use of CSS and gradients and things like that I can go ahead and create that through CSS and not have to export that out as an asset. Now when you do decide that something needs to be exported out, for example, down here our Twitter icon, that icon is going to be a background graphic for us, but I'm going to need to export that out as a transparent PNG file.
Now when I do that, one of the things I'm going to do--and I'm just going to take you over to that icon. I'll export this out as a separate graphic in its own file, and when I do that, I plan out the dimensions for the file very, very carefully. So this particular file is 90x90 pixels, and understanding that and knowing that, it's going to make it a lot easier for me to position this and apply the proper amount of padding to my element so that the icon is going to show up correctly. I'll also center the icon vertically or horizontally where I want it. I might add a little bit of extra space to one side or to the top or the bottom based on how I'm going to be positioning that graphic with other elements on the page.
So when you start creating these sort of stand-alone images that you're going to export out, you have to think a lot about how it's going to interact with the other elements on the page, and do you need to modify it in anyway? What's the perfect size for it? Do you need extra space? Do you need it to be centered in any one location? So those are all things that you'll need to think about. Okay, now that is not by any means an exhaustive list of all the things that you're going to need to consider when planning images and assets for your site. I am fond of saying this and it's absolutely true: every single site is different, and the needs of images from one site to the next, they are going to change, and sometimes very dramatically.
Now what's really important here is that you spend as much time as you can thinking about how images are going to be used on your site, and what's the most efficient way to display those images, and then how to create those assets that work exactly the way you need them throughout the site and with your CSS. Now if you're looking for more information on the specifics of generating assets for your site, I recommend checking out a couple of titles in the lynda.com Online Training Library. Those would be the Illustrator CS5 for Web and Interactive Design, by Mordy Golding, Fireworks CS5 Essential Training, by Jim Babbage, and Photoshop CS5 for the Web, by Jan Kabili.
Those are the three programs that I use to generate most of my assets, and those are three very, very good titles in terms of describing that process to you. Now keep in mind that we're adding new titles to the library all the time, so be sure to check out the library for new titles on that subject, but those titles go into a lot more detailed information that I can in a single movie, so be sure to check those out.
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.