Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,690 --> 00:00:07,020
Image optimization is a great first topic for our course, because it's really something that I think
2
00:00:07,020 --> 00:00:14,850
most people don't think of at first, but it really plays an impact on the performance of your application.
3
00:00:16,160 --> 00:00:21,260
So I'm going to walk you through some of the best practices that I've found for doing this.
4
00:00:21,530 --> 00:00:28,850
Although all of the images in the Project Files folder that you downloaded are already optimized that
5
00:00:28,850 --> 00:00:34,130
way, you don't have to go through and individually follow these steps for all the images that are in
6
00:00:34,130 --> 00:00:34,430
there.
7
00:00:34,640 --> 00:00:36,440
You can just use them as they come.
8
00:00:37,100 --> 00:00:43,100
But I'm going to walk you through the workflow so that you'll understand how I got these images optimized
9
00:00:43,370 --> 00:00:47,180
and how you'll then be able to do that in your own projects.
10
00:00:48,080 --> 00:00:48,620
All right.
11
00:00:48,680 --> 00:00:57,520
So one of the first rules of image optimization is always use as Viji.
12
00:00:58,340 --> 00:01:02,090
Always use SPG when you can.
13
00:01:02,480 --> 00:01:08,900
There's a number of reasons as to why this is so beneficial and why a number of large companies have
14
00:01:08,900 --> 00:01:15,410
recently gone through the effort of switching all of their icons and all of the pictures that they can
15
00:01:15,740 --> 00:01:17,480
into SPG format.
16
00:01:18,110 --> 00:01:22,520
So the first reason for that is SPG is are naturally responsive.
17
00:01:23,510 --> 00:01:27,800
I guess not naturally responsive, depending on how you code them.
18
00:01:27,800 --> 00:01:37,430
Obviously they can have fixed sizes, but they do allow you to scale them as much as you need as big
19
00:01:37,430 --> 00:01:40,850
or small without losing the quality.
20
00:01:41,090 --> 00:01:47,960
Whereas if you tried to blow up a regular picture and make it really, really large, it's going to
21
00:01:47,960 --> 00:01:49,970
start getting blurry very quickly.
22
00:01:50,000 --> 00:01:56,930
And the same thing when you start zooming in and with S.B GS, you don't have to worry about that because
23
00:01:56,930 --> 00:01:59,060
it just automatically re sizes.
24
00:01:59,120 --> 00:01:59,960
That's what it is.
25
00:02:00,050 --> 00:02:07,730
SPG stands for a scalable vector graphic, so scalable meaning can be any size.
26
00:02:08,920 --> 00:02:12,100
So another reason to use SVO GS is it?
27
00:02:12,130 --> 00:02:14,590
They are inherently very small.
28
00:02:14,890 --> 00:02:20,500
So some of the icons that are used in this Web site are only a couple hundred bytes.
29
00:02:20,950 --> 00:02:22,870
That's just bytes big.
30
00:02:23,260 --> 00:02:30,400
So very, very tiny files, which obviously makes it a key Canada for what we want when we're trying
31
00:02:30,400 --> 00:02:32,720
to think about optimizing our images.
32
00:02:33,840 --> 00:02:39,150
And one of the coolest reasons to use SVO GS is that they are customizable.
33
00:02:39,690 --> 00:02:47,190
So what I mean by that is that you can manipulate different properties of the SPG, such as its fill
34
00:02:47,190 --> 00:02:55,600
color or its height and width by providing your own properties and in react especially.
35
00:02:55,650 --> 00:03:02,910
This allows us to do interesting things where we can potentially change the values of those properties
36
00:03:02,910 --> 00:03:06,720
in our S Fijis depending on the state of our UI.
37
00:03:07,680 --> 00:03:14,970
This gives us a lot more control over the images as if they were actual icons and even enables us to
38
00:03:14,970 --> 00:03:20,660
do cool things like use one image and then change which color we needed.
39
00:03:20,670 --> 00:03:25,740
As for, say, a different colored arrow or other similar icons.
40
00:03:26,890 --> 00:03:34,120
If you can't use SPG for whatever reason, then you should almost certainly be using a JPEG or a PMG,
41
00:03:34,300 --> 00:03:39,880
because each of these also has little tricks that I'll show you that allow them to be optimized and
42
00:03:39,880 --> 00:03:45,290
really adjust the standard image formats above any other extraneous options.
43
00:03:46,320 --> 00:03:51,540
All right, so now that we know what file formats we need to be having our images in, I'm going to
44
00:03:51,540 --> 00:03:59,880
show you a live demonstration on the difference between having good optimization for your images and
45
00:03:59,880 --> 00:04:02,640
having bad optimization for your images.
46
00:04:03,540 --> 00:04:10,610
Google page Speed Insight's is an application that lets you test the performance of your Web site.
47
00:04:11,580 --> 00:04:17,730
They base this performance on a number of different factors, but they also provide you with suggestions
48
00:04:17,730 --> 00:04:21,150
on how you can improve the score of your site.
49
00:04:21,510 --> 00:04:28,050
And many people use it as a baseline to make sure that they are delivering the best product possible.
50
00:04:29,160 --> 00:04:39,210
So I have went ahead and found a example of a Web site that doesn't exactly use the best of image optimization
51
00:04:39,210 --> 00:04:39,900
practices.
52
00:04:41,370 --> 00:04:45,810
So this is the Web site of a university in my state.
53
00:04:46,350 --> 00:04:53,360
And you can see here they do have a ninety three for their desktop score, which is very good.
54
00:04:53,430 --> 00:04:57,120
But there still are opportunities for improvement down here.
55
00:04:57,390 --> 00:05:03,390
And I'll show you in a second how this ends up affecting the mobile site where it becomes a lot bigger
56
00:05:03,390 --> 00:05:03,990
of a deal.
57
00:05:04,860 --> 00:05:07,980
Here you can see the all three of these suggestions.
58
00:05:07,980 --> 00:05:15,480
Here are all about images serving your images in next gen formats, efficiently encoding images and
59
00:05:15,480 --> 00:05:17,310
properly sizing their images.
60
00:05:18,500 --> 00:05:24,620
All of this adds together for what could be a war of savings in your loading times, but we're really
61
00:05:24,620 --> 00:05:25,460
makes a difference.
62
00:05:25,490 --> 00:05:27,980
Is your overall transfer size?
63
00:05:28,990 --> 00:05:36,340
If you look down here, you can see that the total transfer size for their home page is 19000 kilobytes
64
00:05:36,400 --> 00:05:43,810
or 19 megabytes, but 18000 kilobytes of that was just four images.
65
00:05:44,880 --> 00:05:53,220
So you can see that if they had more optimized images, then they could reduce the overall size of their
66
00:05:53,220 --> 00:05:56,130
Web site by a pretty significant margin.
67
00:05:57,110 --> 00:06:01,310
You can really see when this becomes a problem, if you come over to any mobile site.
68
00:06:02,000 --> 00:06:10,730
So here you can see a score of just 53, which is significantly lower than the Web site for a desktop.
69
00:06:10,790 --> 00:06:17,750
And here you can see there the serving images in next gen formats, efficiently encoding images and
70
00:06:17,750 --> 00:06:25,400
you're properly sizing of images now is costing you almost a minute of loading time, whereas before
71
00:06:26,120 --> 00:06:27,830
you're only at about eight seconds.
72
00:06:27,890 --> 00:06:33,380
So you can see that it might not seem like a big deal at first, but when you start getting into your
73
00:06:33,380 --> 00:06:38,570
edge cases and your mobile optimization, it really becomes a big bottleneck.
74
00:06:39,630 --> 00:06:46,920
So let's come over here and take a look at an example of a Web site that uses good image optimization
75
00:06:47,580 --> 00:06:48,660
and surprise.
76
00:06:48,930 --> 00:06:50,450
That is my Web site.
77
00:06:51,030 --> 00:06:54,000
The one that we are going to be building throughout this course.
78
00:06:54,420 --> 00:06:58,560
So this is actually the live production version that I have tested.
79
00:06:58,920 --> 00:07:05,220
And you can see my ninety nine, which I am extremely proud of, and I'm able to achieve that.
80
00:07:05,220 --> 00:07:11,640
Ninety nine, while still including tons of icons and custom designed images as well as animations on
81
00:07:11,640 --> 00:07:12,210
the page.
82
00:07:12,750 --> 00:07:16,220
And that is only due to proper image optimization.
83
00:07:17,160 --> 00:07:24,600
If you look down here, you can see that the total transfer size for this entire page was only two thousand
84
00:07:24,660 --> 00:07:25,590
kilobytes.
85
00:07:26,010 --> 00:07:31,800
If you come back over here and look at the bad example that I was showing you and you look at their
86
00:07:31,800 --> 00:07:44,610
images, just this one image is three times the size of the entire total Web site or first page that
87
00:07:44,610 --> 00:07:45,630
this load's.
88
00:07:46,710 --> 00:07:50,280
So there is an extremely significant difference.
89
00:07:50,550 --> 00:07:54,540
And you can really tell now just how important this is to be aware of.
90
00:07:55,350 --> 00:08:02,460
So now let's talk about some actual techniques for how do we go about making sure images are optimized
91
00:08:02,700 --> 00:08:08,130
and then we do reduces file sizes so that you guys can get your ninety nines as well.
92
00:08:09,100 --> 00:08:13,840
So the first site that I'll show you is Tiny Jay dot com.
93
00:08:14,760 --> 00:08:21,420
And this is a really easy site that actually works with Jay, Pegg's and Porgy's, and all you have
94
00:08:21,420 --> 00:08:23,190
to do is drop the file here.
95
00:08:23,700 --> 00:08:25,720
So it's a really well-known site.
96
00:08:25,770 --> 00:08:29,010
You can see all of these companies here, they use it.
97
00:08:29,400 --> 00:08:35,940
And I would highly encourage you running through running your images through this Web site before you
98
00:08:35,940 --> 00:08:38,640
use them in a development project.
99
00:08:39,640 --> 00:08:45,280
You can see with the file that I tried out here, it was able to reduce the size from two point nine
100
00:08:45,280 --> 00:08:50,590
megabytes to just six hundred and eighty seven kilobits, which is in 76 percent reduction.
101
00:08:50,920 --> 00:08:56,020
So that really is significant, especially when you apply that to a large number of images.
102
00:08:56,860 --> 00:09:00,280
So that really is all you need to do for J.
103
00:09:00,280 --> 00:09:01,910
Pegg's and Penn GS.
104
00:09:02,170 --> 00:09:08,650
Although towards the end of the course, I'm actually going to show you another way that you can implement
105
00:09:08,680 --> 00:09:11,700
image optimization with next J.S..
106
00:09:11,860 --> 00:09:13,700
Once we go about implementing that.
107
00:09:14,530 --> 00:09:18,970
But for now, I'll continue by showing you how to optimize as Fijis.
108
00:09:19,920 --> 00:09:28,170
So for SVOD, there is this Web site called You can look up s the g o m g.
109
00:09:28,440 --> 00:09:30,210
And it should be the first link.
110
00:09:30,240 --> 00:09:32,720
And if you want, there's that for your URL.
111
00:09:33,300 --> 00:09:39,970
And what you can do is essentially the same thing of dropping in or opening up your SVO GS.
112
00:09:40,350 --> 00:09:43,050
And it produces an optimized version.
113
00:09:43,890 --> 00:09:51,930
So let me go to the high fidelity design file that you have, and I'm just going to grab this icon right
114
00:09:51,930 --> 00:09:54,300
here and go to the top.
115
00:09:54,390 --> 00:09:57,930
Go to file and I'm going to export selected.
116
00:09:59,700 --> 00:10:02,370
And I'm going to make sure that that's an SPG.
117
00:10:02,400 --> 00:10:06,450
And I'm going to just export this to my desktop, calling it icon.
118
00:10:07,440 --> 00:10:08,550
And export.
119
00:10:10,040 --> 00:10:19,670
And I'm going to come back over here to SPG o m g and open this up to my desktop, select the icon.
120
00:10:21,270 --> 00:10:22,480
And here it loads up.
121
00:10:22,500 --> 00:10:23,250
A preview of it.
122
00:10:23,310 --> 00:10:30,500
So this is a preview of the optimized version so that you can make sure that it looks the same and it
123
00:10:30,500 --> 00:10:35,310
still retains the qualities and properties that you are expecting.
124
00:10:36,280 --> 00:10:38,450
But if you look down here, you can tell.
125
00:10:38,470 --> 00:10:45,330
The here is the original size, which, like I said, is extremely small for SPG is only four hundred
126
00:10:45,330 --> 00:10:51,310
and eighteen bytes, but it was still able to crunch some numbers and reduce that down to just three
127
00:10:51,310 --> 00:10:52,900
hundred and forty six bytes.
128
00:10:53,830 --> 00:10:56,110
Now here the percentage is different.
129
00:10:56,320 --> 00:11:02,650
It tells you what percent the new file size is of the old file size.
130
00:11:02,890 --> 00:11:10,270
So this three hundred forty six bytes still retains 82 percent of the original file size, which is
131
00:11:10,300 --> 00:11:13,210
approximately an 18 percent reduction.
132
00:11:14,080 --> 00:11:17,680
So not as significant is the last file that I had tested out.
133
00:11:17,950 --> 00:11:20,530
But this one is already pretty small to begin with.
134
00:11:21,950 --> 00:11:27,500
So, again, this is all you really have to do for your S.V., geez, if you just make sure that you
135
00:11:27,500 --> 00:11:34,400
drop them in through here and have optimized every single one, then you will have reduced the file
136
00:11:34,400 --> 00:11:42,380
sizes by a significant margin and we'll be ready to start developing a fast performing application.
137
00:11:43,540 --> 00:11:45,850
I will still show you a couple tricks, though.
138
00:11:46,180 --> 00:11:55,900
And so if you have Photoshop, you can actually come up to the export under file and go to export as
139
00:11:56,470 --> 00:11:58,230
an in this dialogue.
140
00:11:58,540 --> 00:11:59,680
If you select J.
141
00:11:59,680 --> 00:12:04,540
Peg to export, you can actually control the quality right here as well.
142
00:12:05,020 --> 00:12:07,020
So you can see at 100 percent.
143
00:12:07,300 --> 00:12:10,600
This is going to end up being one point two megabytes.
144
00:12:11,230 --> 00:12:13,930
But if you drop that down to, say, 10 percent.
145
00:12:15,270 --> 00:12:18,270
Then you're only 317 kilobytes.
146
00:12:18,330 --> 00:12:20,610
So, again, a significant reduction.
147
00:12:21,890 --> 00:12:27,710
With this approach, though, you are going to need to go in and make sure that the exported file still
148
00:12:27,710 --> 00:12:35,480
retains the same quality as the previous one, and then it doesn't have any distortion or too much blurriness
149
00:12:35,720 --> 00:12:38,150
that would make it unusable.
150
00:12:39,270 --> 00:12:48,030
So I have actually went through and exported this image using this way in Photoshop as well as the online
151
00:12:48,060 --> 00:12:48,870
optimizer.
152
00:12:49,080 --> 00:12:52,890
And I just wanted to show you guys how those compared.
153
00:12:53,310 --> 00:12:55,530
So that was the.
154
00:12:56,860 --> 00:12:59,860
Tiny jay pad that I used to sew in the background.
155
00:13:00,140 --> 00:13:01,060
Pair right here.
156
00:13:01,780 --> 00:13:03,400
And you can see.
157
00:13:07,660 --> 00:13:11,480
That the original was two point nine megabytes.
158
00:13:12,630 --> 00:13:13,890
And this one.
159
00:13:15,720 --> 00:13:24,330
From the tiny jpeg is only six hundred and eighty eight kilobytes, and the final one optimized through
160
00:13:24,360 --> 00:13:28,950
Photoshop is just three hundred and twenty five kilobytes.
161
00:13:29,010 --> 00:13:31,590
So that is half the size of that one.
162
00:13:31,890 --> 00:13:37,560
And way smaller, almost 10 times smaller than this original one.
163
00:13:37,890 --> 00:13:41,100
So if I go through and open all of these up.
164
00:13:41,490 --> 00:13:44,520
Let me see if you can even tell the difference between them.
165
00:13:47,260 --> 00:13:48,880
So there is the original.
166
00:13:51,760 --> 00:13:54,460
There is from tiny jpeg.
167
00:13:58,590 --> 00:13:59,940
And this is from Photoshop.
168
00:14:01,060 --> 00:14:05,830
So you can see those are all pretty darn similar.
169
00:14:05,920 --> 00:14:14,520
I would say, and for a lot of images I would saying that that similarity in quality is probably going
170
00:14:14,520 --> 00:14:15,520
to be acceptable.
171
00:14:15,850 --> 00:14:22,690
So depending on which images you have and what your setup requires, you'll may have to play with those
172
00:14:22,690 --> 00:14:28,060
settings and see which one gives you the best file size for the best quality.
173
00:14:28,690 --> 00:14:31,760
But that really was about all the tips and tricks.
174
00:14:31,780 --> 00:14:35,710
There are two image optimization is pretty straightforward.
175
00:14:35,740 --> 00:14:40,990
You just need to make sure you're running your images through these optimizers.
176
00:14:41,050 --> 00:14:48,760
And in the correct formats and the balancing which approach works best for the quality that you're looking
177
00:14:48,760 --> 00:14:49,180
for.
178
00:14:49,570 --> 00:14:55,480
And that will really make a difference when you're working later to speed up your site and give you
179
00:14:55,480 --> 00:14:59,570
the peace of mind knowing that your images aren't going to be a problem.
18371
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.