[
フレーム]
>> HENRI: All right. I guess I'm using the mic. Not wireless. It's all good. I can make it happen. Actually I'm just going to do this. Sorry. I like to pace around. So I'm just going to hold on to it like this.
Maybe I won't. Okay. So okay. I guess everyone can hear me. Man, so I just wanted to address one thing real quick. Oh, my god, what's going on here? Okay. Well, I guess it's not super bright. No sweat. What was that? Okay. I can't tell.
Okay. So basically yes. My name's Henri. I'm French. And my sorry. My handle is Henri Helvetica. I thought it was interesting and had a good ring to it. But a lot of people believed it was my real last name. So I'm here to say it's absolutely
not my real last name. And now I felt weird. I thought I was having this Obama birther movement. People are like, snappy last name. I'm so bummed, whatever. People kept asking me. I'm sorry. Mean Santa Claus. So I just wanted to get that
out of the way.
But that is my Twitter handle. So you can hit me up all day. Anyway how, yes, I'm from Toronto. I do run. I enjoy that quite a lot. And in fact today's Tuesday, so if I was back in Toronto I'd probably be running with my running club tonight.
So in an ode to that and my coach, she likes to do this thing. It's actually pretty cold in here. If I could get everyone to join me in a bit of a hand clapping situation.
[Clapping]
That's what I'm talking about. So we're going to have some fun. I'm here to talk about whoa. What's going on here? Oh, there's Kanye. There he is. I couldn't tell if he was around or not. Kanye approves.
So I'm also going to do this. I'm going to give away some books later on today. I'm a big fan of books. I love reading them. So if you want to sort of take this down, you can take a screen shot of it or whatever, picture. You want to Tweet
that later on during lunch, I'll be giving away these books and just hit you up. Yo, come check me out. I have a book for you. Obviously it's related to all this. Anyhow, let's get cracking.
Normally around this talk I used to kind of show this video, but especially today since I'm short on time, I'm not going to get into it. But it's basically a very well-known developer, asked what's going on with the Web and what's going
on. And he went on a rant, it needs to change. It's Kyle Simpson. Very well-known JavaScript developer and this is what he had to say. The Web is primarily being built by a group of people that take for granted and you can see the rest.
And he went on to add something like this. Sorry, guys. I'm trying to get comfortable. All right.
And then, you know, he chimed in some more with something like that. Actually, no, that was me. And, honestly, this is the reality. And I know somebody talked about this yesterday. But this is actually Tim's desk. He's got a great 11 inch
Macbook Pro Air, I believe. And the awesome ultra-wide LG screen. Those are signed of sick. I'm trying to get my hands on those. But these are beautiful devices. And this is kind of like what we're working on. But it's not the reality of
the planet. The world.
Outside of North America it's not that gangster. Yeah. And Kyle Simpson added with more details here. This is absolutely true. You know, the way we are crafting the Web there's quite a few people outside of North America in these emerging
markets who are not going to get what we're doing. And in fact this is part of a a blog post that on Facebook engineering page. And they talked about how they went to Africa and they were trying to get a sense of what was going on in the
hand sets and how they were trying to make their sites faster.
So this is a promise that they have made as well. Now, getting back to Tim Kadlec, he talked about this. I think it's a cultural thing, primarily. Cultural. And I want to talk about that as well. There are two things that I think are very
important. And one of them is accessibility. One of them is performance as well. And with regard to the performance thing I also believe that it's cultural. If I have to do one thing and one thing only, I want to make sure that everyone
leaves here with the idea that they need to craft the Web with performance in mind.
Because, again, I'm going to get into some examples. Once you get into developing countries it gets very tough. And we're going to talk about images. And images pretty much are the lowest hanging fruit when it comes to performance. And speaking
of fruit, anyone from the West Indies here? I'm pretty sure I'm going to see no one. But I have to ask. Anyone been to been to the West Indies. Okay. A couple. Pare down. Anybody been to Jamaica? Okay. This is a fruit from the ackee tree.
And essentially when not cooked properly this is actually deadly. And I've compared performance to dieting quiet often. And this is pretty much a very good parallel. You mishandle images, bad things will happen. And we're going to get into
that.
So like I said, performance pretty much dying and we'll see some parallels. So I want to welcome everyone to the hateful weight. I guess you guys hadn't seen that. I thought I posted it. But I thought I was going to have some fun. Word play,
et cetera, et cetera. But we're basically going to explore some of the challenges that images are making. Some of the challenges we have with the Web. And images. So the hateful weight. This is a five part tragedy. Man, this has got to be
a bit better. Act zero, we're going to talk about how we got here and you're going to see it's actually a lot more common than you believe. We're going to get into the implications, UX, the networking that's involved. You're going to see
that as well. The main characters, the villains in the tragedy. And we all know who they are. And then get into the denouement. And then credits, et cetera, et cetera, et cetera. Anyways. Let's go.
How we got here. Man. I don't know sorry, guys. I'm so like not comfortable right now. So it starts in a place that pretty much is here. And if anyone knows what this is, it takes you pretty much to Buffalo, New York. Right outside of Toronto,
in fact. And someone by the name of Obama was not there. But the gentleman on the left, does anyone know who that is? That is Steve Sasson. He basically created this. The very first digital camera ever. About 77, 87, eight pounds. Zero.01
megapixels and photos tyke like 23 seconds to transfer to that cassette. Some of you guys might remember how data used to go to cassettes back in the day. Back if the day. And this was pretty much how big it was. Imagine putting this in
your pocket. If you could.
But it progressed, about 25 years later, to something like this. And now we have something like this. And if you've not seen this, this is 7 plus with the two cameras. Gets like god, like 60 some megaphotos when you do the panoramic. And
you can actually ask Mr.Snook somewhere around here. He brought his. Anyhow. But the point is that it's become very cultural to just have your camera with you and snap all day long.
And essentially these photos are finding their way to the Web. We love pictures that tell a fantastic story from sad moments to very scintillating ones as well. Now, anyone familiar with photowalks? Any photographers here? Anyway, photowalks
are a group of people that get together and they man may just go on walks together and snap photos all day long. And you'll see it's very somewhat in the 20, 25, 30 age range kind of. And they're snapping photos and sharing them online.
And this is sweat pants Steve. One of the leaders of this community. But here this is happening also overseas. And you can see right here people, again, taking photos. Same area. And with the goal of sharing them a little later. We share
experiences.
It is cultural. Rest assured. In fact Facebook, 105% more comments when the post is associated to a photo. Anyone knows what this means? Yeah? I guess so. This? This. This. Again. This is all cultural. We've become accustomed to sort of
sharing our stories with photos all day long.
2012, 500million photos were shared daily. In 2015, that was 3billion. All right? And it's not slowing down. Anyone familiar with Unsplash? It's kind of like a high res photo stock image sight. They're out of Montreal, actually. Great
resource if you want to get some stuff. Anyhow, each month 1billion images viewed, 5.5million photos downloaded.
And again, this is about the sharing process. Since the Web is a great sharing medium, we end up with heavy page. But it's not you, it's cultural. Like I said. Anyways, get into details. 2012, it was 20 megs, and today, manageable. 2012,
50 requests, 696 kilobytes. And 2016, 57 requests, 1.5. Not that many more requests. And 64% of the pages are just straight images. You can imagine this is going to be significant weight. Part of the issues as well is things like responsive
Web design happened. And no matter how you slice it some complications have come about with that as well. And one of them is retina images.
We all know retina images to an extent. It's about three to four times the actual amount of pixels that you need for displaying. And then you have things like this. Device fragmentation. Now this is 2015 and every little block there represents
a device out on the planet being used.
So things are pretty complicated. Hey. Seventy two% of pages send the same content to mobile. Just think about that one. Raise your hand if you're trying to be part of the 28%. Oh, people doing their math in their head. What? What is he
talking about? Yes, you want to win.
And, again, you have situations like this. Now, I like to hang out in the network panel quite often. I don't know if you can see that, but you will when I push the slides out. You have quite often improperly sized images. And in fact when
I was speaking to someone in a conversation, so, what do you think is the most common issue in terms of, like, image management? And he's like, pages I mean, images are being sent down to the right container.
Here's a Tweet from just about a year ago. So, again, imagine asking for a tall coffee and being charged for a venti. This is pretty much what's happening right now.
And you can tell down there, 280 crass, but the sent one that was about a 1,000 across. So you basically have an immense amount of useless pixels being sent down the pipe to the client.
So, again, users, we don't like page weight and we're going to deal with it. So what are the implications of this? There are some serious implications in fact. There's user experience involved. There's network. So the Web is slowing down.
Yeah, kind of. Because think about it. The Web is very rich. The applications we're sending down, the Websites, JS, it's like animation. It's page weight. It's render images. Things are slowing down. And what are we really after? Designers,
developers? Very good or fantastic user experience. And user experience is also for usability. Because you know when that site comes up and you're kind of seeing stuff happening, but you're not sure what's going on, that's an unusable page.
And part of the issue is some of the page weight that we're dealing with.
Now, in some very recent stats, and this came out last week, 53% of visitors will abandon a page when it takes three seconds or more to load. They're saying the sweet spot is somewhere around 2, 2.5 seconds. But at 3 customers are gone.
Imagine that. Three seconds. Here's another stat that was pretty interesting. Any sort of like blog or media site sort of practitioners here maybe? This is important. For you, anyhow.
And then we get into some perversions, even. Obviously that's going to be important. That's where you make your money. And this is from a couple years ago. And you can see some of these stats on it this Website, WPOstats which is a site
that's being cure rated by Tim and Tammy. Great performance engineers. And she mentioned that sessions that converted had 38% fewer images. Fewer images. So let's talk about this money again. Netflix very common, very well known brand
saw 43% decrease in their bandwidth bill after turning on Gzipping. It's compression. Imagine turns on gzipping, compressing the data and almost cutting the bill in half.
Back to Unsplash here. Anyone here host their clients themselves potentially? Or yeah, kind of. These are things that you want to think about as well. Now, Unsplash, that site I was telling you about, 2016 hosting costs in one month. The
bandwidth alone was 10 grand. So, again, imagine slicing that more or less in half if you could. That's what I'm talking about. But it's not enterprise only. So this is Dave newton who's actually a senior Dev over at Shopify and this is
something that happened to him. This is fairly common. People hit their data cap and they can't do much. He was so angry well, then again he was talking about some sites. But he was so angry he took it to Twitter. And I said, dude, this
is so gold, this is going to be a slide one day. There it is.
And, again, this is something else that Facebook commented about. And they realized that it's very important to optimize images, to make sure that your users are not blowing caps just because they're on your site. I actually keep an eye
on my data as well even though I'm good with it.
Just so that you know the idea that you might blow that data cap is becoming more and more common and people are using these all the time. Now, one of the challenges out there is the fact that the Devs I'm not saying they're not doing their
job but browsers realize this is a big problem. So now we have these things called well, this is called browser interventions where basically they try to save the day. This is Opera, ye of 250million users in Europe. They have a suite
of apps that are there to basically help you with data savings. And you can see right here is a screenshot, again, doesn't come up super clear. But over on the left hand side you can see that they'll tell you what they have been saving for
you in terms of data. And over on the right you'll see some extra details. Like right here.
And you're actually able to sort of manage the images that are coming down the pipe because they realized a lot of the times they're not coded properly. Or optimized properly. And that's just to show you right there. And again, how does
Opera turtle work? It shaves off image pixels. They realize the data caps are being blown through images mostly. Google Chrome, in fact, is thinking about implementing lazy loading within the browser.
Because I could get into greater detail, but, again, it goes back to the idea that why load an image if the user is not going to look at it? But right now that's happening as we speak.
And, again, getting back to the idea that there's also a networking element to it, the network from the 4G, 3G, 2Gs that are all over the planet, they're not always our friends. This is a shot of and this is from Facebook as well. This
is a shot of connectivity across the world. And I don't know if you can see this well, but yellow is 4G. Blue is 3G. And 2G is red. Now, it's predominantly yellow in North America and that's really it. And when you have 4G or 3G or 2G, t
it's never like 100% 4G, 100% 3G. It's sort of 3G ish, 2.5, what? These are things you need to take into consideration.
Now, something happen?
[ Laughter ]
So, again, they want Facebook to work for everyone no matter the region, network, condition, or mobile device. Now, these are the things that you can look at yourself as well. And this is a Tweet that I had from who knows when. But you can
go and someone talked about this yesterday. You can actually go into Dev tools and network throttle the page. So that you could actually test this yourself. You know, you might be at home, like, oh, man, I got my whatever. But you go in
and drop it down and you have a bunch of settings so you see how the page will load in a browser with limited bandwidth. And, of course, with some latency as well. So those are some of the implications on a UX level. Dollar level. And also
networking.
But now let's take a look at the main characters. Again, 2016, 2.4 megs, that's the average site. Fifty seven requests. 1.5 megs. Of those 1.5 megs, 1% SVG. These stats are coming from HTTP archive where they get data from the top million
sites. One% with anyone familiar with WebP image format? When we leave it's going to be all hands. You like that, my man?
24% GIF. We're going to talk about that in a hot minute. Twenty% PNGs, and obviously 44% jpg. Which is, JPEG, the most common format.
Now, let's talk about the GIF. The most antiquated format for sure. Format, it's lossless. It was a bit of a fade for quite a while. It had the alpha channel. Transparency. Extremely well supported. Been around the longest. Ironically fading
in popularity. A lot of people like to use animated GIFs. But quite often these animated GIFs are not animated GIFs anymore. And some of these GIF purveyors and merchants are giving you mp4s. As a format they are too big, get very heavy
and sort of falling out of preference. But like I said, it's antiquated.
And some would actually tell you that it's actually a completely useless format. Everything that it does, there's another format that does it better. That's the bottom line. So my recommendation to you is no dice in the GIF. GIF, GIF, whatever
you want to call it. So you look at the PNG. Or PNG, portable network graphic. Part of what I'm doing right here, actually I'll get into that after. So, yeah, 1996. The PNG came after a battle with the GIF and became a bit of a better format.
Raster format, lossless. And there's some lossy compression involved. We can talk about that. Alpha channel, support, and to this day, the PNG is a bit of a trade for the transparency element. Phenomenal support. You can see right across
it's green.
And everyone here is familiar with can I use the Website, yeah? Just plug in whatever you want to check and see what the support's like. It's grown all around. Obviously the PNG is a great format. You can get some animated PNGs. But here's
one thing you have to keep in mind.
Actually this format and the JPEG which I'll get into a little later, they both contain Exif metadata. Hands up if you're familiar. Hands up if you're stripping it out of the files. Okay.
So let me show you something right here. This was a shot I took while at Starbucks testing a site. And I was like, man, let me see what this metadata is seeing. Well, this is what's in fact this is only a part of what's embedded in the
picture. So you'll get god. You'll get like the device name. You'll get obviously the size, the pick, the geolocation, why you are, et cetera, et cetera, et cetera. In fact you can look this up, but crooks have been caught just off the
EXIFdata from photos which is totally wild to me. Anyhow, this is the kind of stuff you have to strip out. Because in fact this can take up to 15 to 17% of your image alone. If you had a 100K image that had Exif data in it, you're talking
about saving potentially 16 to 17Ks, very important especially if you're taking this to scale.
Now, let's talk about the SVG. I'm going to race through this quick. There's some very, very knowledgeable SVG people in the place here. And I would not feelcomfortable skipping over details. You can check with them. You know who you are.
Anyhow, the SVG, fantastic format as well. Now, even know it's only 1% of the top million sites, I think this is something that's going to change. I mean, top million, you're talking about, you know, there are some antiquated sites in there
and whatnot. But vector format, very important. This is something that's going to be resolution independent. You're also talking about it's really good for logos, icons and illustration. As Sara Soueidan mentioned earlier, there's decision
making with the SVG. If the image is way too detailed, it's a good chance the SVG is going to come out too heavy. But these are things you have to figure out in your meetings.
Now, SVG, again, fantastic support. You can look at it right here. Green across the board. And, again, in terms of sort of like compression, does well with gzipping, SVGO and a great tool to compress it. Even though it's at 1%, it's growing
in had popularity. And conferences, everyone is talking about it. Oh, man, I got to put an SVG here. It's totally working. You definitely want to keep the SVG in mind.
Now, let's get to the WebP. Sorry, guys. Now, very, very recent technology from Google, of course. Lossy and lossless compression. Has an alpha channel. You get some transparency. And you can get some animation out of it. Now, what are the
challenges? Poor support at current. And there aren't the most encoding tools for it. There are a couple that you could use. But I'll get into that later as well. Also with the WebP it's a bit of like a buzz saw. You get fantastic data savings.
For now, I kind of want to expand on that. The WebP came out, whatever, man. I'm going to talk about this. Firefox, Mozilla, they weren't really stoked about it and felt the JPEG still had room for optimization. Which it did. But one thing
for sure, you couldn't deny the WebP. Any hockey fans in here? All right. Does anyone know who this is? Probably not. This is Willy O'Ree, a Canadian, the first African American in the NHL. 1957.
So I just took a quick screenshot and I was on my phone. And this was about like 1.5 megs or so. And this is the kind of compression that took place. And I don't know if you can see this real quick, but again, you'll see it in the slides.
The original ping was about 6 megs. So I went down to a loss list, WebP, which was 3.5 megs. Like no no size differences in terms of like dimensions.
Then I went down to an 85 quality JPEG, an 85 quality from like Photoshop. That came out to like 1.1 megs. But at 85 the WebP came out to 340 kilobytes. Now we could get into the, well, you know, we have to check out quality. And the quality
thing is a much different conversation. And I mean, I'm going to talk about it about is at the end as well. But these are significant savings right here. And, you know, what ended up happening is basically we figured out that, yes, it's
going to have a promising future.
Even though you have a situation like this where you don't have a lot of support. But that's all going to change. Because this happened earlier this year.
Now, I'm a big Safari fan. You can boo me all you want. But I still use Webkit all day long. They actually had WebP support in beta for like a week and a half and then pulled it. Well, you know, we're just experimenting or whatever. But
this is actually very significant. Because this is likely coming back. Now, I mentioned earlier that Mozilla, Firefox, they池e like, well, you know, we're really about the JPEG, et cetera, et cetera. But this happened.
The same bug essentially reopened the bug for WebP implementation. And it looks something like that. So basically what's happening is this. You have the major browsers outside of obviously Chrome who implements it, or should I say Blink
Engines which also includes Vivaldi. Is Molly here? She's not. You're going to have in the near future a lot more support for WebP. This is something to keep in mind. I don't have the slide up, but look at browser share across the planet,
Chrome is between 50 to 59%. So six out of ten people across the planet are using Chrome. Again, significant savings for your users. Now let's get to the workhorse, the JPEG. We know it very well. Lossy, yes, lossless as well. And I can
get into those details. Fantastic support. That's, again, without a doubt that's not being debated. The most common format by far. And as well this is the format that's coming out of all your cameras. So, again, this is something you want
to keep in mind.
Now, best for photographs, obviously. And the Exif data you have to strip out. And when I say it's capable of extreme compression. So without getting into the real heavy computational conversations, but you're able to get even more savings
by doing this thing called scan layer optimizations. And what you thought was on optimized JPEG, there's room to go. And I will have notes about that later. You're drawing blood from a stone essentially.
The interesting part about the jpg, interesting variants. The JPEG 2000, unfortunately it's Webkit or Mac supported only. Losses, great compression. The same thing happened with the jpg xr. Again, another format that came out of Microsoft.
Pretty much the same details. Great compression, lossless, but also an alpha channel. Now, what ends up happening is this: when you start to serve these images and depending on the browser you might be able to serve a jpg2000 if you know
it's a Safari client or a jpg xr if it's that client. Some are doing it as we speak. You may not know is as a user. You may not care. You want the image to come in as fast as possible. So those are the main characters. Now the denouement.
So what does this all mean? Again, what you have is what I was trying to basically convey by having all these formats and laying their strengths and weaknesses is the decision making that you have to go through with your team. So when you're
sitting down with designers and developers and UX people and all in between, you can make the proper decision as to which image format is going to be used for which perfect, say. If you have an illustration the chances are you're going to
look at the idea of having like an SVG. If you have a very crisp picture you might be like, okay, maybe this is going to be a good JPEG or a PNG. Who knows?
So there is decision making in this whole process. So what I'd like to say is always keep performance in mind. This is super, super important. Again, the emerging markets, they're all coming in on mobile phones. And mobile fines can't handle
what we've been sort of like shipping out current because, again, in America we're very comfortable. We got the 4G, you know, LTE networks, et cetera. But we have situations like, say, in India, which is the fastest growing market as we
speak.
And in fact I'll give you a quick story. I was at velocity last week. Anyone know velocity? It's a conference, they talk about DevOps and performance. Ran into a gentleman who said he was having issues with images. Okay, let's talk about
it. Out of nowhere they actually start to get a bunch of traffic out of India. And they're like, okay, cool.
But they also realized some of the issues they were having because some of their users were constantly having problems accessing the content. So dude was just pulling his hair out. And that was part of the reason he was at velocity. So you
need to keep performance in mind at all times. Plan your image strategy.
Like I said, sit down with your team, figure out what you need to do. Have these conversations. Maybe it's a situation where you might not use a particular image if you think it's going to give you a hard time.
Again, be kind to your users. Understand where they're coming from. Look at your analytics. See how you can improve the user experience in light of their situations. Optimize as much as possible. Obviously that goes without saying. Maybe
you want to offload some of the work. Use a CDN. Depending on how big your project is. And, of course, use the tools at your disposal. Now, this is I'm not going to say this is like super easy, but something that I do all the time. I literally
live in the network panel. And, you know, Safari, Chrome, Vivaldi, Opera, they all have it. And you can always take a look at what's going on at your image management. And your site, really. And, you know, something like this you can see
clearly with the it's like kind of like a waterfall chart in a sense.
Now, I know I raced through this. But this is pretty much the end. I know we are behind schedule, so I was trying to accommodate all as much as possible. Now, credits, resources. These are some of the people that I think you should follow.
Again, I'm going to put the slides up. Tammy Everts, amazing out of Vancouver, Google, Steve Souders, the pontiff of performance. Then there's some other guy. And a bunch of other people who I think do great work. I'm actually going to give
away the two this one right here. So if you're Tweeting me I'm going to get at you.
But these are actually also all available. That one's online. You can read for free. Designing for performance is a great book as well. You can read that for free. If you want to get really nerdy and get into some compression there's a book
on the far right which came out just maybe a couple months ago. And I also want to talk about this book right here. This actually is on its way out from O'Reilly as well. But it's a joint venture. And they talk about some of the issues in
much greater details when it comes to images and how to ship and how to deliver, et cetera. And I'll be giving away that book as well. Extra readings you'll see. And that's really it. Thank you very much.
[ Applause ]
>> CLAUDINA: I thought you lived in Toronto. You said you lived in the come. Let's have some questions.
>> HENRI: That was funny.
>> CLAUDINA: You might have to leave that one over there.
>> HENRI: Oh, man, come on, now. Miriam took the wireless one. What can I say?
>> HENRI: Inside the Actors?Studio.
>> CLAUDINA: Inside the Dev Studio with Henri and NCCS. All right, what are your techniques to handle images responsibly and responsibly and responsibly?
>> HENRI: I mean god. I didn't talk about like the picture tag or anything like that. But that's something you definitely want to keep in mind. Source that. Again, I just believe it's beyond I actually think that people just grab pictures
from the net and just throw it in their pages. And I see some head nods. I'm not calling anyone out. I'm just saying, you know, these are the kind of mistakes that I see. So I do believe it does take a bit more planning outside of just
finding a photo you like and going ahead with it.
Now there's some changes taking place as we speak. You know, I did talk about the picture tag real quick right now. And source set tag. But there's something called client hints that's coming around the corner. It's like going through an
implementation right now. It's in a flag. But they realize it's gotten a little complicated and they're doing the best to, you know, it's almost like a browser intervention again. You know? They just want to lessen the load for develop developers
and all the decision making they have to do. So yeah.
>> CLAUDINA: And lastly, do you have any image PDNs that you like to use or recommend?
>> HENRI: The thing about the CDNs is they all actually have their own qualities. There are some big ones, obviously. But even some of the small ones, they tend to sort of like have their own sort of little services and whatnot. So these
are conversations that you literally have to have with them. And depending on what you need. But for the most part they're out there to help you with some of these issues. Especially if you're going to scale. Because, again, on, you know,
a I don't know. Like a small mom and pop shop you might be able to handle this yourself. But once you're dealing with much bigger companies I do believe like a CDN is somewhere you want to go to and have the conversations and see what they
can do for you in terms of their services and whatnot. Because they have a lot more, you know, under the hood than you do essentially.
>> CLAUDINA: Great. Thank you so much for talk.
[ Applause ]