Responsive Web Design Essentials - HTML5 CSS3 Bootstrap

How to export responsive images for website from XD Photoshop Illustrator

Daniel Walter Scott

Download Exercise Files Download Completed Files

Contents

Certificates

We’re awarding certificates for this course!

Check out the How to earn your certificate video for instructions on how to earn yours and click the available certificate levels below for more information.

Introduction

I recommend hosting your new website with Bluehost, you can get a big discount by signing up with this link: https://www.bluehost.com/track/byol/byol_webess_85

You need to be a member to view comments.

Join today. Cancel any time.

Sign Up
All right, I wanted to double back in this video to images. We've done images in an earlier video, but I want to kind of really highlight responsive images. Now that we understand what responsive is, we're going to need some different images. Now for our kind of 100% stretching method that we'll do next, we just need a very big image, and we're going to scale it down, it's easy enough. The method after that, called the srcset method, the source set, it's going to require physical different images at different sizes, and we're going to turn them on and off, depending on the physical width and the pixel density. 

So first up we're going to work with Photoshop. Make sure the image you want to resize is open within it. Now Photoshop is not the absolute best Web Design image program, but it gets used so commonly for doing Web Design, so we'll cover that first. Let's to 'File', let's go to 'Export', we're going to use 'Export As'. You might have to reset yours, your quality is probably at 100. It will remove the last thing you've done. You might just hit your scale back to 100, you might have to bend some of these if you've got it. 

So what I want to do is, I want it to be a JPEG because it's an image, that looks like it needs to be a JPEG. I'm going to have the quality maybe down at 60 so it looks fine. Now the smaller size, we'll start with the smallest. Let's say I want it to be a width of-- so you need your overall dimensions, so mine is, by default 300 pixels wide. As long as it's bigger than what you need it, because I want it to be, the small size to be 400. It's going to be quite small, the ratio kind of works out of our favor. So you got to make sure-- don't worry if it gets a little bit off. 

So we're going to target our mobile phone on a bad screen, and that's going to be our kind of times 1, 'x1'. Then what I do is I add one more, and this one is going to be the times 2, 'x2' for high DPI. You can see, you can do 'x3'. I'm going to say, that's what I'm going to do, and hit 'Export'. On my desktop I'm going to put them, just lump them there. I haven't given them a very good name, but hopefully, here they are. So there's that first image, and there's my second one. Now I'm going to open them back up in Photoshop, just to show you the size difference. So that is the small one there, and that is the big one at twice the size. So that's how to get kind of two versions out of Photoshop. XD is very similar. 

Let's say I've got this image in my mock-up here, I select it. I double click it so I've got the image part of it, and I go 'File', 'Export'. I'm going to export the selected one, and down here this is the changing. So down here instead of just Design we're going to go to Web. It's going to give me, you can kind of see my teeny tiny writing. The editor will zoom in, so you'd be able to see it fine, but you can see, you'll get a 2x and a 1x. If you're doing stuff for iOS, so that is iPhones or iPads, they will require a x3. Android requires, oh geez, Android, so many, but we're going to do just one and two times. I'm going to export it to my Desktop as well. Give it a name, that's a bad name. It's going to fly to this, because we've kind of done it already, just wanted to show you that--

That's why you end up with this one with that 2x at the end. It's just twice the size of the original. I'm going to open them up in Photoshop, just to show you, big version, small version. So for a 100% method we're just going to use this one and scale it down, and when we do our source set method we're going to switch between these two images, depending on the browser size and the pixel density. 

The last one is Illustrator, that gets used commonly. So this one here, if it didn't have a Gradient and wasn't-- call this Drop shadow, I'd probably just use our SVG. So what we need to do is, 'Window', you need to open up 'Assets Export'. Select the thing you want to export, drag it into this panel. Give it a better name then I've got. Then down here is where you decide. So SVG is not going to work in this case, so I'm going to have to pick JPEG. I'm picking a 50% JPEG, doesn't give me 60, so I want to take 50. Let's add a suffix to it, that is, I don't need that. You can have it, it's just like adding to the file name. 

So I'm going to have a version 1, I'm going to have a version, you can see, you can go real high. So I'm going to have just a version 2. It's going to add that suffix to the end to match the rest of them. I'll also make it that one, it's adding the minus. When it says -50, really just says, I'm a 50% quality JPEG. I'm going to do those two, I am going to, what am I going to do? I'm going to click on him so he goes blue, then I'm going to click 'Export', and we end up at the same place, so 'Desktop', 'Export.' I should have two, called backgrounds. Oh, even put it into little groups; thank you, Illustrator. Not sure if that's thank you, but anyway, I got two of them, 1, 2, I'll open them both up in Photoshop, so I can see the size difference. I don't know why. I don't believe you trust me. Anyway, small version, gigantic version, I'll show you. That is the small version, at 100%, and that's the other version. Double the size; massive. 

So we've got our images, let's work through the rest of this responsive image section, and we'll start implementing them. See you in a sec.