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
€42.67
List Price:  €59.74
You save:  €17.07
£36.41
List Price:  £50.98
You save:  £14.56
CA$68.39
List Price:  CA$95.75
You save:  CA$27.36
A$76.46
List Price:  A$107.05
You save:  A$30.59
S$63.70
List Price:  S$89.18
You save:  S$25.48
HK$392.40
List Price:  HK$549.39
You save:  HK$156.99
CHF 40.02
List Price:  CHF 56.03
You save:  CHF 16.01
NOK kr503.23
List Price:  NOK kr704.56
You save:  NOK kr201.33
DKK kr318.33
List Price:  DKK kr445.69
You save:  DKK kr127.35
NZ$82.50
List Price:  NZ$115.50
You save:  NZ$33
د.إ183.59
List Price:  د.إ257.04
You save:  د.إ73.45
৳6,073
List Price:  ৳8,502.69
You save:  ৳2,429.68
₹4,284.19
List Price:  ₹5,998.21
You save:  ₹1,714.02
RM211.40
List Price:  RM295.98
You save:  RM84.58
₦77,211.05
List Price:  ₦108,101.65
You save:  ₦30,890.60
₨14,180.91
List Price:  ₨19,854.41
You save:  ₨5,673.50
฿1,622.57
List Price:  ฿2,271.74
You save:  ฿649.16
₺1,987.51
List Price:  ₺2,782.68
You save:  ₺795.16
B$277.80
List Price:  B$388.94
You save:  B$111.14
R883.36
List Price:  R1,236.78
You save:  R353.41
Лв83.41
List Price:  Лв116.78
You save:  Лв33.37
₩67,776.17
List Price:  ₩94,892.06
You save:  ₩27,115.89
₪169.69
List Price:  ₪237.58
You save:  ₪67.89
₱2,834.68
List Price:  ₱3,968.78
You save:  ₱1,134.10
¥7,208.83
List Price:  ¥10,092.94
You save:  ¥2,884.11
MX$942.44
List Price:  MX$1,319.50
You save:  MX$377.05
QR181.09
List Price:  QR253.55
You save:  QR72.45
P662.97
List Price:  P928.22
You save:  P265.24
KSh6,461.20
List Price:  KSh9,046.20
You save:  KSh2,585
E£2,494.32
List Price:  E£3,492.25
You save:  E£997.93
ብር6,818.69
List Price:  ብር9,546.71
You save:  ብር2,728.02
Kz45,588.63
List Price:  Kz63,827.73
You save:  Kz18,239.10
CLP$47,160.37
List Price:  CLP$66,028.30
You save:  CLP$18,867.92
CN¥358.45
List Price:  CN¥501.86
You save:  CN¥143.41
RD$2,938.51
List Price:  RD$4,114.15
You save:  RD$1,175.63
DA6,472.96
List Price:  DA9,062.66
You save:  DA2,589.70
FJ$111.99
List Price:  FJ$156.79
You save:  FJ$44.80
Q381.95
List Price:  Q534.77
You save:  Q152.81
GY$10,388.42
List Price:  GY$14,544.62
You save:  GY$4,156.20
ISK kr6,076.78
List Price:  ISK kr8,507.98
You save:  ISK kr2,431.20
DH453.52
List Price:  DH634.96
You save:  DH181.44
L846.14
List Price:  L1,184.67
You save:  L338.52
ден2,627.27
List Price:  ден3,678.39
You save:  ден1,051.12
MOP$401.49
List Price:  MOP$562.12
You save:  MOP$160.63
N$885.82
List Price:  N$1,240.22
You save:  N$354.40
C$1,827.19
List Price:  C$2,558.21
You save:  C$731.02
रु6,838.93
List Price:  रु9,575.06
You save:  रु2,736.12
S/178.61
List Price:  S/250.07
You save:  S/71.46
K205.83
List Price:  K288.18
You save:  K82.35
SAR187.48
List Price:  SAR262.49
You save:  SAR75
ZK1,164.42
List Price:  ZK1,630.29
You save:  ZK465.86
L216.35
List Price:  L302.90
You save:  L86.55
Kč1,056.79
List Price:  Kč1,479.59
You save:  Kč422.80
Ft17,047.31
List Price:  Ft23,867.60
You save:  Ft6,820.28
SEK kr472.57
List Price:  SEK kr661.64
You save:  SEK kr189.06
ARS$59,487.59
List Price:  ARS$83,287.39
You save:  ARS$23,799.79
Bs343.10
List Price:  Bs480.36
You save:  Bs137.26
COP$201,855.59
List Price:  COP$282,613.98
You save:  COP$80,758.39
₡25,110.22
List Price:  ₡35,156.33
You save:  ₡10,046.10
L1,297.14
List Price:  L1,816.10
You save:  L518.96
₲396,422.51
List Price:  ₲555,023.23
You save:  ₲158,600.72
$U2,010.36
List Price:  $U2,814.67
You save:  $U804.30
zł181.18
List Price:  zł253.66
You save:  zł72.48
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.