All language subtitles for 146 Image Optimizations.en_US

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranî)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian Download
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
vi Vietnamese
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu
Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated: 1 00:00:01,380 --> 00:00:02,630 In this lecture, 2 00:00:02,630 --> 00:00:04,755 I'm finally gonna show you how we can 3 00:00:04,755 --> 00:00:07,850 and should optimize our images 4 00:00:07,850 --> 00:00:10,760 both in terms of the image dimensions 5 00:00:10,760 --> 00:00:15,293 and also of the actual file size in terms of kilobytes. 6 00:00:17,150 --> 00:00:18,170 Now, actually, 7 00:00:18,170 --> 00:00:21,464 I already did most of the image optimizations here 8 00:00:21,464 --> 00:00:24,350 so that we don't waste too much time. 9 00:00:24,350 --> 00:00:27,980 So let me just tell you what I did on some images. 10 00:00:27,980 --> 00:00:31,500 So of then after that we can together optimize 11 00:00:31,500 --> 00:00:33,093 this big hero image here. 12 00:00:34,720 --> 00:00:37,530 So let's take, for example, these ones here. 13 00:00:37,530 --> 00:00:39,293 So these application screens, 14 00:00:40,270 --> 00:00:43,240 so right now here they are at the biggest size 15 00:00:43,240 --> 00:00:46,270 that they will ever be, right? 16 00:00:46,270 --> 00:00:48,470 So as we scale the layout down, 17 00:00:48,470 --> 00:00:50,770 the images will only get smaller. 18 00:00:50,770 --> 00:00:53,470 And so it's important that we do this analysis 19 00:00:53,470 --> 00:00:56,663 at the biggest size that the image will ever be. 20 00:01:00,080 --> 00:01:01,200 Now, anyway, 21 00:01:01,200 --> 00:01:06,200 the image right now occupies a width of a 187 pixels. 22 00:01:07,460 --> 00:01:11,063 So that's what we can see up here above the image. 23 00:01:12,650 --> 00:01:16,270 Now, remember the lecture about images from way back 24 00:01:16,270 --> 00:01:18,350 in the design section. 25 00:01:18,350 --> 00:01:22,290 So back then I told you that the actual image size, 26 00:01:22,290 --> 00:01:26,080 so off the image file itself should always be double 27 00:01:26,080 --> 00:01:31,080 of the size that is actually displayed on the screen, right? 28 00:01:31,220 --> 00:01:33,200 So hopefully you will remember that 29 00:01:33,200 --> 00:01:35,620 and if not, then you can always go back 30 00:01:35,620 --> 00:01:38,143 and check out that parts of the lecture. 31 00:01:39,120 --> 00:01:40,950 So just as a quick summary, 32 00:01:40,950 --> 00:01:44,313 the reason why we need an image that is double the size 33 00:01:44,313 --> 00:01:47,860 that is actually displayed on the screen is that 34 00:01:47,860 --> 00:01:50,640 these high density screens actually need 35 00:01:50,640 --> 00:01:55,640 two pixels of the image to display one pixel in the design. 36 00:01:55,660 --> 00:01:57,210 So in the layout. 37 00:01:57,210 --> 00:01:59,060 So again, I explained to dead before. 38 00:01:59,920 --> 00:02:03,220 Now, anyway, the actual image size, 39 00:02:03,220 --> 00:02:07,070 we can get it by hovering here over at the image. 40 00:02:07,070 --> 00:02:11,440 And so you'll see the intrinsic size is 400 by 809 41 00:02:12,748 --> 00:02:16,577 and the rendered size again is 188 by 379. 42 00:02:18,910 --> 00:02:20,690 So the intrinsic size. 43 00:02:20,690 --> 00:02:23,950 So the actual size of the image is 400, 44 00:02:23,950 --> 00:02:28,120 basically because I rounded this 188 here to 200 45 00:02:28,120 --> 00:02:31,563 and then I made the image itself, double of that. 46 00:02:32,530 --> 00:02:33,770 All right? 47 00:02:33,770 --> 00:02:36,510 So basically the process is this, 48 00:02:36,510 --> 00:02:39,620 we start with a really big image if we have it. 49 00:02:39,620 --> 00:02:41,150 So in this case, 50 00:02:41,150 --> 00:02:44,680 it was probably like a thousand pixels or so wide. 51 00:02:44,680 --> 00:02:46,810 And then when I finished the design, 52 00:02:46,810 --> 00:02:50,760 I checked out the largest with that image we'll ever have. 53 00:02:50,760 --> 00:02:54,340 And so that's, again, these 188 pixels here, 54 00:02:54,340 --> 00:02:56,780 and then I rounded that to 200 55 00:02:56,780 --> 00:02:59,390 and then doubled that to 400. 56 00:02:59,390 --> 00:03:02,270 And then I went ahead and resize the image 57 00:03:02,270 --> 00:03:05,760 to have a width of just 400 pixels. 58 00:03:05,760 --> 00:03:07,440 All right. And so with that, 59 00:03:07,440 --> 00:03:11,550 I finished the first step of the optimization process. 60 00:03:11,550 --> 00:03:14,693 So the part that is about the image dimensions. 61 00:03:15,670 --> 00:03:17,253 And the same, for example here. 62 00:03:18,900 --> 00:03:20,263 So let's inspect that. 63 00:03:21,170 --> 00:03:25,810 And so you see that the intrinsic size is 700. 64 00:03:25,810 --> 00:03:27,870 And so that's because I rounded, 65 00:03:27,870 --> 00:03:30,480 the surrendered size here to 350, 66 00:03:30,480 --> 00:03:35,210 which double makes 700. 67 00:03:35,210 --> 00:03:39,440 Now where I did not do that is on this one. 68 00:03:39,440 --> 00:03:41,303 So here in our hero image. 69 00:03:42,170 --> 00:03:44,593 So let's inspect that as well. 70 00:03:46,512 --> 00:03:50,410 And then, so here the intrinsic size, 71 00:03:50,410 --> 00:03:55,410 so the actual size of the image is 1400, almost 1500, 72 00:03:55,920 --> 00:04:00,823 but the width that has been rendered is only 570 pixels. 73 00:04:01,860 --> 00:04:06,570 So we now need to resize this image as a first step. 74 00:04:06,570 --> 00:04:10,070 So let's round this to 600 and make the image 75 00:04:10,070 --> 00:04:12,143 then 1200 pixels wide. 76 00:04:13,124 --> 00:04:15,070 Okay? 77 00:04:15,070 --> 00:04:18,310 So let's come here again to these files. 78 00:04:18,310 --> 00:04:22,670 And once again, you will need some program to resize images. 79 00:04:22,670 --> 00:04:24,463 So make sure to download that. 80 00:04:25,630 --> 00:04:28,760 Or of course you can as always just use the file 81 00:04:28,760 --> 00:04:31,320 from the final files. 82 00:04:31,320 --> 00:04:34,970 So as I said, the width should just be 1200. 83 00:04:34,970 --> 00:04:39,360 And so that is only 80% of the beginning. 84 00:04:39,360 --> 00:04:44,360 So it was 2.9 megabytes, and now it will be only 1.9. 85 00:04:44,440 --> 00:04:46,393 And so that's already a nice saving. 86 00:04:47,940 --> 00:04:52,710 So I saved it and this should now have been reloaded. 87 00:04:52,710 --> 00:04:55,500 And of course it looks exactly the same, 88 00:04:55,500 --> 00:05:00,357 but now you see that the intrinsic size is just 1200 pixels. 89 00:05:00,357 --> 00:05:01,423 All right? 90 00:05:02,290 --> 00:05:03,980 So that was important 91 00:05:03,980 --> 00:05:07,790 but that's only half of the things that we need to do. 92 00:05:07,790 --> 00:05:10,780 So the other half is to actually compress now the image 93 00:05:10,780 --> 00:05:13,650 in order to actually reduce the file size, 94 00:05:13,650 --> 00:05:17,600 because as you saw here, it's still has two megabytes, 95 00:05:17,600 --> 00:05:20,190 which is way too much. 96 00:05:20,190 --> 00:05:22,743 So that's not really acceptable. 97 00:05:23,670 --> 00:05:24,730 And in fact, 98 00:05:24,730 --> 00:05:29,300 we can check out the entire size of the page basically 99 00:05:29,300 --> 00:05:33,313 by coming here to the network tab and then reloading. 100 00:05:34,670 --> 00:05:38,720 So you'll see that it transferred 3.9 megabyte. 101 00:05:38,720 --> 00:05:41,193 And so again, that's way too much. 102 00:05:44,900 --> 00:05:48,000 So the tool that we can use to compress images 103 00:05:48,000 --> 00:05:50,160 is called Squoosh. 104 00:05:54,324 --> 00:05:56,741 So that's Squoosh.app, right? 105 00:05:59,090 --> 00:06:00,040 And so here we can, 106 00:06:01,880 --> 00:06:03,670 well, there are different ways. 107 00:06:03,670 --> 00:06:05,763 Let's just do this way here. 108 00:06:06,950 --> 00:06:09,293 So selecting our image. 109 00:06:12,300 --> 00:06:14,223 And so now it is compressing here. 110 00:06:17,710 --> 00:06:18,970 So here on the left side, 111 00:06:18,970 --> 00:06:21,050 we have our original image 112 00:06:21,050 --> 00:06:22,190 and then on the right side 113 00:06:22,190 --> 00:06:24,403 we have a compressed version of that. 114 00:06:25,350 --> 00:06:28,470 Now, right here, it is using the JPEG format, 115 00:06:28,470 --> 00:06:31,320 which is not going to work because with JPEG, 116 00:06:31,320 --> 00:06:36,160 we cannot have basically transparent parts of the image. 117 00:06:36,160 --> 00:06:37,240 So you'll see that now here, 118 00:06:37,240 --> 00:06:40,220 the image turned black where in the original 119 00:06:40,220 --> 00:06:43,283 it is transparent and the same down here. 120 00:06:44,500 --> 00:06:45,450 So at JPEG, 121 00:06:45,450 --> 00:06:50,120 we could compress it a lot down to 125 kilobytes, 122 00:06:50,120 --> 00:06:52,120 but then we would lose the transparency. 123 00:06:53,480 --> 00:06:56,073 So let's try here, browser PNG. 124 00:06:58,015 --> 00:07:00,210 And so that doesn't really work. 125 00:07:00,210 --> 00:07:02,363 So here we don't have a lot of compression, 126 00:07:04,140 --> 00:07:05,863 so let's try this OxyPNG. 127 00:07:08,360 --> 00:07:10,173 And so that is doing something here. 128 00:07:11,390 --> 00:07:15,103 And it did reduce it 15%. 129 00:07:16,380 --> 00:07:19,623 So let's try to increase that here to three, this effort. 130 00:07:21,320 --> 00:07:25,170 See if that changes anything. Well, not really. 131 00:07:25,170 --> 00:07:27,170 So here we don't have to play around a little bit 132 00:07:27,170 --> 00:07:29,730 with these different options that we get 133 00:07:29,730 --> 00:07:31,890 for each of the image files. 134 00:07:31,890 --> 00:07:34,203 So that doesn't change anything as all. 135 00:07:35,320 --> 00:07:37,923 So let's try this one here, reducing the pallette. 136 00:07:39,660 --> 00:07:42,423 And so now indeed, that went down by a lot. 137 00:07:43,428 --> 00:07:47,590 But let's see what debt compression cost us. 138 00:07:47,590 --> 00:07:49,940 So you'll see that here, her face, for example, 139 00:07:49,940 --> 00:07:52,413 is a lot worse than it was before. 140 00:07:53,920 --> 00:07:57,905 And the entire image does look a lot worse 141 00:07:57,905 --> 00:08:01,003 when we compare it with the original one. 142 00:08:02,950 --> 00:08:06,393 Let's try again with the normal PNG. 143 00:08:08,640 --> 00:08:10,840 So there it doesn't compress a lot. 144 00:08:10,840 --> 00:08:13,070 So here we still have 124 145 00:08:13,070 --> 00:08:16,230 and it still doesn't look so nice. 146 00:08:16,230 --> 00:08:17,740 So let's try this one here again, 147 00:08:17,740 --> 00:08:21,920 and I'm not sure if this is going to work actually, 148 00:08:21,920 --> 00:08:24,100 but still let's try this one. 149 00:08:24,100 --> 00:08:26,703 So I will download it by clicking this button. 150 00:08:29,413 --> 00:08:30,403 And there it is. 151 00:08:32,000 --> 00:08:34,203 And then I will put it right here. 152 00:08:36,260 --> 00:08:38,590 So let's say keep both, 153 00:08:38,590 --> 00:08:41,050 and then I will change the name here. 154 00:08:41,050 --> 00:08:44,143 So hero-min. 155 00:08:45,400 --> 00:08:48,820 And then let's just try to replace that here 156 00:08:48,820 --> 00:08:50,223 and see how it looks like. 157 00:08:51,720 --> 00:08:55,223 So that's right here. 158 00:09:01,600 --> 00:09:05,120 And well, you see that the size of the page 159 00:09:05,120 --> 00:09:07,180 is now a lot less, 160 00:09:07,180 --> 00:09:11,250 but the image does also not look so great anymore. 161 00:09:11,250 --> 00:09:15,580 I mean, it's still okay, but it's not as good as before. 162 00:09:15,580 --> 00:09:17,990 So we can actually do something else 163 00:09:17,990 --> 00:09:20,300 and something which is much better, 164 00:09:20,300 --> 00:09:23,020 which is to, instead of using PNG, 165 00:09:23,020 --> 00:09:27,403 we can use a very new and modern image format called WebP. 166 00:09:28,890 --> 00:09:32,830 So let's try WebP and out of the box immediately, 167 00:09:32,830 --> 00:09:37,247 we get a compression of 95%, right? 168 00:09:39,230 --> 00:09:40,910 Now, if we check it out here, 169 00:09:40,910 --> 00:09:44,320 then it doesn't look really good. 170 00:09:44,320 --> 00:09:48,453 So let's increase the quality here just a little bit. 171 00:09:51,220 --> 00:09:53,313 All right. That's still not perfect. 172 00:09:54,200 --> 00:09:56,833 So what if we gave it 100% quality? 173 00:09:58,600 --> 00:10:00,803 Well, that's still not so great. 174 00:10:01,700 --> 00:10:03,713 Let's try lossless, maybe. 175 00:10:06,770 --> 00:10:10,253 Well, that's, doesn't look really lossless to me. 176 00:10:11,810 --> 00:10:14,893 Let's try to decrease this even further. 177 00:10:16,140 --> 00:10:18,140 And so here it's now a game basically 178 00:10:18,140 --> 00:10:20,190 of finding the right balance 179 00:10:20,190 --> 00:10:23,323 between the image quality and the compression. 180 00:10:24,430 --> 00:10:27,260 So lossless doesn't really work. 181 00:10:27,260 --> 00:10:29,733 So let's again, try a quality of 100, 182 00:10:30,650 --> 00:10:34,003 but that doesn't seem to change the image here a lot. 183 00:10:35,460 --> 00:10:38,200 So this doesn't really look so nice. 184 00:10:38,200 --> 00:10:40,460 Maybe if we try to increase the effort 185 00:10:41,820 --> 00:10:45,483 or probably even better would be to reduce the palette. 186 00:10:49,911 --> 00:10:53,083 So now actually it looks really, really good. 187 00:10:54,210 --> 00:10:57,103 So I'm not that worried as you can see 188 00:10:57,103 --> 00:10:58,900 over these two other images, 189 00:10:58,900 --> 00:11:00,920 but this one here is the most important, 190 00:11:00,920 --> 00:11:02,720 because it's the most prominent one. 191 00:11:04,000 --> 00:11:06,340 So 400 kilobyte is still a lot. 192 00:11:06,340 --> 00:11:09,673 So let's try to put it back down to 70 something. 193 00:11:11,900 --> 00:11:15,710 And yeah. Beautiful. Just 100 kilobyte. 194 00:11:15,710 --> 00:11:18,730 But now it is back to being disbrulled. 195 00:11:18,730 --> 00:11:21,822 Let's try something like this. 196 00:11:21,822 --> 00:11:25,020 So again, finding the right balance here, 197 00:11:26,419 --> 00:11:27,913 it's still not perfect. 198 00:11:33,140 --> 00:11:36,040 All right. But now I'm actually satisfied. 199 00:11:36,040 --> 00:11:39,440 Now I just want to get it like below 200. 200 00:11:39,440 --> 00:11:40,933 Let's try this here, maybe. 201 00:11:44,547 --> 00:11:45,413 All right? 202 00:11:46,520 --> 00:11:50,430 So this looks good while having a really good size here 203 00:11:50,430 --> 00:11:52,080 of 200 kilobytes 204 00:11:52,080 --> 00:11:55,283 and so let's download it like this. 205 00:12:02,310 --> 00:12:06,833 So hero.WebP, and now let's include that here. 206 00:12:08,840 --> 00:12:11,260 But actually let me copy this, 207 00:12:11,260 --> 00:12:12,480 comment this one out 208 00:12:13,660 --> 00:12:16,800 put this here, so hero.WebP. 209 00:12:20,730 --> 00:12:22,900 So let's see our page. 210 00:12:22,900 --> 00:12:25,343 And indeed here it is. 211 00:12:27,890 --> 00:12:29,023 Let's try that again. 212 00:12:30,070 --> 00:12:33,433 For some reason. Now this bottom part is no longer visible. 213 00:12:35,560 --> 00:12:40,560 Well, anyway, let's just inspect this here. 214 00:12:42,030 --> 00:12:45,450 And yeah, so this is the one that we just created 215 00:12:45,450 --> 00:12:49,250 and here this image looks beautiful, right? 216 00:12:49,250 --> 00:12:51,960 We cannot really see that it has been compressed, 217 00:12:51,960 --> 00:12:55,763 but well, we reduce the file size in 90%. 218 00:12:57,050 --> 00:12:59,890 However, there is one problem with this, 219 00:12:59,890 --> 00:13:03,430 so we cannot leave it like this and call it a day. 220 00:13:03,430 --> 00:13:05,183 That would be too easy. 221 00:13:06,070 --> 00:13:08,903 So let's come back here to, Can I use, 222 00:13:10,330 --> 00:13:13,530 and let's write WebP here 223 00:13:13,530 --> 00:13:17,140 because that's just another thing that we can check out 224 00:13:17,140 --> 00:13:19,430 how it is supported in browsers. 225 00:13:19,430 --> 00:13:24,430 And so here, you can see that safari has partial support. 226 00:13:24,960 --> 00:13:27,180 So you can see that down here, 227 00:13:27,180 --> 00:13:30,993 which means that it is only available on mac Os 11. 228 00:13:32,690 --> 00:13:37,280 On mobile safari, it does actually work, but not on iOS 13, 229 00:13:37,280 --> 00:13:40,430 which was released only two years ago. 230 00:13:40,430 --> 00:13:43,650 And the same for these a little bit older Firefox, 231 00:13:43,650 --> 00:13:48,650 which also is from 2018, so not all too long ago. 232 00:13:48,770 --> 00:13:51,860 So right now our image will not be displayed 233 00:13:51,860 --> 00:13:55,940 in some browsers and that is really bad, right? 234 00:13:55,940 --> 00:13:58,253 We don't want that to happen at all. 235 00:13:59,350 --> 00:14:03,230 So there there's something we can do about that fortunately. 236 00:14:03,230 --> 00:14:04,090 And so here, 237 00:14:04,090 --> 00:14:06,360 let me show you how we can use 238 00:14:06,360 --> 00:14:09,710 a really nice trick with HTML. 239 00:14:09,710 --> 00:14:12,270 So here, instead of using image, 240 00:14:12,270 --> 00:14:16,573 or at least outside of the image, we will create a picture. 241 00:14:19,010 --> 00:14:19,970 All right? 242 00:14:19,970 --> 00:14:23,143 And it doesn't need any class, doesn't need anything really. 243 00:14:24,040 --> 00:14:27,270 And so here we will now define the two possible images 244 00:14:27,270 --> 00:14:28,880 that we have. 245 00:14:28,880 --> 00:14:32,670 So we have our WebP hero image 246 00:14:32,670 --> 00:14:35,853 and we also have to compress PNG that we created before. 247 00:14:37,800 --> 00:14:40,640 So let's define the source element here 248 00:14:40,640 --> 00:14:43,083 and then with the source set, attribute. 249 00:14:44,370 --> 00:14:49,370 So just like this, and it'll let define first the WebP, 250 00:14:49,530 --> 00:14:50,423 for example, 251 00:14:53,820 --> 00:14:55,509 and then we also tell the browser 252 00:14:55,509 --> 00:15:00,120 that this image is of the type or that this file 253 00:15:00,120 --> 00:15:02,453 is of the type image WebP, 254 00:15:03,410 --> 00:15:06,880 because here we could actually also define videos, 255 00:15:06,880 --> 00:15:07,713 for example. 256 00:15:09,180 --> 00:15:12,513 So this is one of them let's duplicate it. 257 00:15:15,350 --> 00:15:16,643 And then heromin.PNG. 258 00:15:21,640 --> 00:15:24,233 And this one is image/PNG. 259 00:15:27,050 --> 00:15:29,880 And so now what's going to happen is that the browser 260 00:15:29,880 --> 00:15:33,100 will basically select which of these two images here 261 00:15:33,100 --> 00:15:35,420 it can display the best. 262 00:15:35,420 --> 00:15:40,170 So for those browsers who cannot display the WebP. 263 00:15:40,170 --> 00:15:43,550 So this one, it will simply then select this one. 264 00:15:43,550 --> 00:15:46,800 But if the browser is able to render WebP, 265 00:15:46,800 --> 00:15:48,960 which is the most of the browsers, 266 00:15:48,960 --> 00:15:51,373 then it will choose this one and render it. 267 00:15:52,350 --> 00:15:55,303 Now, where will the browser actually render it? 268 00:15:56,360 --> 00:15:59,900 Well, basically inside of this image. 269 00:15:59,900 --> 00:16:02,100 So we still need the image. 270 00:16:02,100 --> 00:16:03,543 So let me cut it from here, 271 00:16:05,110 --> 00:16:08,173 remove all that and then paste it here. 272 00:16:09,200 --> 00:16:10,350 All right? 273 00:16:10,350 --> 00:16:14,930 So we will still have to class here on this image. 274 00:16:14,930 --> 00:16:17,740 So we are styling the image and we're also providing 275 00:16:17,740 --> 00:16:20,100 the alt text on this image. 276 00:16:20,100 --> 00:16:23,300 But the browser will then basically simply replace 277 00:16:23,300 --> 00:16:27,093 whatever source we have here, which one of these two. 278 00:16:28,590 --> 00:16:31,380 And here actually, we want to fall back. 279 00:16:31,380 --> 00:16:34,060 So basically the one that will be displayed 280 00:16:34,060 --> 00:16:36,303 in case that the browser does not understand 281 00:16:36,303 --> 00:16:38,410 the source elements, 282 00:16:38,410 --> 00:16:41,363 because this is also something a bit newer. 283 00:16:44,040 --> 00:16:45,090 All right. 284 00:16:45,090 --> 00:16:48,370 So again, here is the fallback, 285 00:16:48,370 --> 00:16:50,200 which means basically diversion, 286 00:16:50,200 --> 00:16:53,093 that all browsers should be able to render. 287 00:16:53,960 --> 00:16:55,600 And so, yeah, 288 00:16:55,600 --> 00:16:58,670 this is how we can select basically 289 00:16:58,670 --> 00:17:01,660 two different images here and let the browser decide 290 00:17:01,660 --> 00:17:03,253 which one works best. 291 00:17:05,010 --> 00:17:05,933 So let's see. 292 00:17:07,340 --> 00:17:10,473 And indeed everything works beautifully here. 293 00:17:10,473 --> 00:17:12,433 Let's again, inspect that. 294 00:17:13,880 --> 00:17:17,250 And so if we now hover over this image chores, 295 00:17:17,250 --> 00:17:21,050 so you'll see, is test heromin.PNG, 296 00:17:21,050 --> 00:17:22,610 but if we hover over it, 297 00:17:22,610 --> 00:17:24,980 then you see that the current source 298 00:17:24,980 --> 00:17:26,780 is still hero.WebP 299 00:17:28,090 --> 00:17:30,690 And so that's exactly what I explained before. 300 00:17:30,690 --> 00:17:32,430 So it's the browser, 301 00:17:32,430 --> 00:17:35,070 basically only selecting this one 302 00:17:35,070 --> 00:17:37,000 and only downloading this image 303 00:17:37,000 --> 00:17:39,393 and then replacing that source here. 304 00:17:41,690 --> 00:17:42,523 All right. 305 00:17:42,523 --> 00:17:45,620 And that is how we can use a high-performing image format 306 00:17:45,620 --> 00:17:48,070 like WebP to be able to 307 00:17:48,070 --> 00:17:52,293 really, really down images while maintaining their quality. 308 00:17:54,330 --> 00:17:55,163 All right? 309 00:17:55,163 --> 00:17:58,170 And that's of course is specially important for big images 310 00:17:58,170 --> 00:18:02,240 like this one who take up a lot of space. 311 00:18:02,240 --> 00:18:04,420 So please don't neglect this part 312 00:18:04,420 --> 00:18:06,550 when you're building your own websites. 313 00:18:06,550 --> 00:18:09,230 So compressing images is really something 314 00:18:09,230 --> 00:18:11,093 that you must do for your users. 315 00:18:12,785 --> 00:18:13,618 And with this, 316 00:18:13,618 --> 00:18:17,468 I now finally consider our website complete and finished 317 00:18:17,468 --> 00:18:20,620 and ready to be launched to the internet. 318 00:18:20,620 --> 00:18:22,950 And so that's exactly what we're gonna do 319 00:18:22,950 --> 00:18:24,533 in the next lecture. 23248

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.