Grayscale Filter

3 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€47.46
List Price:  €66.45
You save:  €18.98
£39.51
List Price:  £55.32
You save:  £15.80
CA$70.02
List Price:  CA$98.04
You save:  CA$28.01
A$76.94
List Price:  A$107.72
You save:  A$30.78
S$67.20
List Price:  S$94.09
You save:  S$26.88
HK$389.03
List Price:  HK$544.68
You save:  HK$155.64
CHF 44.22
List Price:  CHF 61.92
You save:  CHF 17.69
NOK kr553.39
List Price:  NOK kr774.79
You save:  NOK kr221.40
DKK kr354.03
List Price:  DKK kr495.67
You save:  DKK kr141.64
NZ$84.87
List Price:  NZ$118.82
You save:  NZ$33.95
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.46
৳5,956.37
List Price:  ৳8,339.40
You save:  ৳2,383.02
₹4,224.20
List Price:  ₹5,914.23
You save:  ₹1,690.02
RM222.30
List Price:  RM311.24
You save:  RM88.94
₦84,340.62
List Price:  ₦118,083.62
You save:  ₦33,743
₨13,850.18
List Price:  ₨19,391.36
You save:  ₨5,541.18
฿1,721.45
List Price:  ฿2,410.17
You save:  ฿688.72
₺1,731.12
List Price:  ₺2,423.71
You save:  ₺692.59
B$299.09
List Price:  B$418.75
You save:  B$119.66
R909.26
List Price:  R1,273.04
You save:  R363.77
Лв92.76
List Price:  Лв129.87
You save:  Лв37.11
₩69,804.67
List Price:  ₩97,732.12
You save:  ₩27,927.45
₪182.52
List Price:  ₪255.55
You save:  ₪73.02
₱2,935.98
List Price:  ₱4,110.61
You save:  ₱1,174.63
¥7,592.73
List Price:  ¥10,630.43
You save:  ¥3,037.70
MX$1,012.85
List Price:  MX$1,418.07
You save:  MX$405.22
QR181.67
List Price:  QR254.36
You save:  QR72.68
P680.94
List Price:  P953.37
You save:  P272.43
KSh6,473.70
List Price:  KSh9,063.70
You save:  KSh2,590
E£2,484.78
List Price:  E£3,478.89
You save:  E£994.11
ብር6,300.31
List Price:  ብር8,820.94
You save:  ብር2,520.62
Kz45,539.99
List Price:  Kz63,759.63
You save:  Kz18,219.64
CLP$48,857.72
List Price:  CLP$68,404.72
You save:  CLP$19,547
CN¥362.50
List Price:  CN¥507.53
You save:  CN¥145.03
RD$3,004.64
List Price:  RD$4,206.74
You save:  RD$1,202.09
DA6,679
List Price:  DA9,351.13
You save:  DA2,672.13
FJ$113.46
List Price:  FJ$158.85
You save:  FJ$45.39
Q384.56
List Price:  Q538.41
You save:  Q153.85
GY$10,428.44
List Price:  GY$14,600.65
You save:  GY$4,172.21
ISK kr6,868.12
List Price:  ISK kr9,615.92
You save:  ISK kr2,747.80
DH499.43
List Price:  DH699.24
You save:  DH199.81
L915.32
List Price:  L1,281.52
You save:  L366.20
ден2,917.02
List Price:  ден4,084.06
You save:  ден1,167.04
MOP$399.43
List Price:  MOP$559.24
You save:  MOP$159.80
N$904.34
List Price:  N$1,266.15
You save:  N$361.80
C$1,834.22
List Price:  C$2,568.06
You save:  C$733.83
रु6,733.81
List Price:  रु9,427.87
You save:  रु2,694.06
S/187.60
List Price:  S/262.66
You save:  S/75.05
K200.98
List Price:  K281.39
You save:  K80.41
SAR187.78
List Price:  SAR262.91
You save:  SAR75.12
ZK1,359.51
List Price:  ZK1,903.42
You save:  ZK543.91
L236.20
List Price:  L330.70
You save:  L94.50
Kč1,199.49
List Price:  Kč1,679.39
You save:  Kč479.89
Ft19,679.45
List Price:  Ft27,552.80
You save:  Ft7,873.35
SEK kr546.91
List Price:  SEK kr765.72
You save:  SEK kr218.80
ARS$50,389.68
List Price:  ARS$70,549.59
You save:  ARS$20,159.90
Bs344.45
List Price:  Bs482.26
You save:  Bs137.81
COP$219,921.39
List Price:  COP$307,907.55
You save:  COP$87,986.15
₡25,458.51
List Price:  ₡35,643.95
You save:  ₡10,185.44
L1,260.66
List Price:  L1,765.02
You save:  L504.36
₲389,612.59
List Price:  ₲545,488.80
You save:  ₲155,876.21
$U2,141.18
List Price:  $U2,997.83
You save:  $U856.64
zł204.49
List Price:  zł286.31
You save:  zł81.81
Already have an account? Log In

Transcript

So at first, we're going to talk about this grayscale filter, which allows us to convert the image to grayscale. So here's a demo. This is the original image, and this digital percent grayscale filter effect. But if I look at this second image, well, this image has 50% grayscale filter applied to it. But when he talks about this third image, well, this image is have 100% grayscale filter applied to it. So if grayscale filter value is zero percent, well, it will be original image.

And if you're applying hundred percent, well, it was completely turned into gray. Obviously, we'll see this base color filter in action. But first, let me tell you that what kind of value you can pass as a parameter in this grayscale filter. So here you go. This is our grayscale function, and you can pass number or percent value as a parameter. So let me just go to my quatre where I'll show you this grayscale function in action.

So here I am on my quatre. And we're going to work on these last few images which have a class of image two and Ms three. So let me Go here. And let me just apply this filter to image two. So I'm gonna say here filter, and this is going to be grayscale. Now what happens if I don't pass any value to this grayscale filter?

Well, let me just show you if I save it, and if I go here, you see the second image turned into completely gray. Well, that's because hundred percent is a default value for this grayscale function. Let me prove you that so I'm going to copy this from here, and I'm going to paste it on this image tree. And I'm going to apply this 100% specifically, okay, so I'm going to save it and if I go here, you see that our second and ptolemies are completely tornado gray. So you see that I haven't passed any value. So blitzscale function will automatically will to put 100% and in 30 minutes and specifically saying that make it 100%.

So it will go to convert this current image into grayscale completely. So let me just pass here 50% and when I pass here, a 50%. If I just go here, you see that now we have 50% risk applied to this Second image, and hundred percent on this third wave. So zero, percent and 100%. And let me just tell you that you can pass two kind of value as a parameter in this grayscale function. The first one is this person, and the second one is the number.

So if you want to make it hundred percent, well get rid of everything and just make it one. One is equal to 100%. Because that's a number. This is how you represent 100%. In number, if you want to make it 50%, well, you need to pass as 0.5. If I go here, you will not see any difference.

You see, it's again 50%. And this app, hundred percent grayscale effect. So that's pretty neat here, and again, if you want to make it 10% Well, it's gonna be 0.1 and a finger here, do you see that we have only 10% basically applied to this second image, which is barely noticeable, but you get the idea. So let me just go here. And if you want to pass zero percent, well just make it zero. I'm just gonna say the zero percent a scale.

Now, let me just tell you one important thing is that this is a critical function. do not accept any negative value. So if you pass in a negative value just like this A minus one, well, it will not work. You see, this grayscale filter didn't apply to this image. That's because this grayscale feature, do not accept any negative value. So make sure you pass a positive value.

So let's make it 0.5. And now you see that we have this original image. Then we have descriptive percent grayscale and then we have this hundred percent grayscale. And this is how you can make your images gray using grayscale function in CSS image filters.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.