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
€46.73
List Price:  €65.43
You save:  €18.69
£39.55
List Price:  £55.38
You save:  £15.82
CA$68.39
List Price:  CA$95.75
You save:  CA$27.36
A$76.50
List Price:  A$107.11
You save:  A$30.60
S$68.11
List Price:  S$95.36
You save:  S$27.25
HK$391.33
List Price:  HK$547.90
You save:  HK$156.56
CHF 45.19
List Price:  CHF 63.27
You save:  CHF 18.08
NOK kr551.82
List Price:  NOK kr772.60
You save:  NOK kr220.77
DKK kr348.47
List Price:  DKK kr487.88
You save:  DKK kr139.41
NZ$84.17
List Price:  NZ$117.84
You save:  NZ$33.67
د.إ183.60
List Price:  د.إ257.06
You save:  د.إ73.45
৳5,499.99
List Price:  ৳7,700.43
You save:  ৳2,200.43
₹4,169.28
List Price:  ₹5,837.33
You save:  ₹1,668.04
RM238.32
List Price:  RM333.67
You save:  RM95.35
₦66,060.50
List Price:  ₦92,489.99
You save:  ₦26,429.48
₨13,951.51
List Price:  ₨19,533.24
You save:  ₨5,581.72
฿1,848.80
List Price:  ฿2,588.46
You save:  ฿739.66
₺1,625.07
List Price:  ₺2,275.23
You save:  ₺650.15
B$255.76
List Price:  B$358.08
You save:  B$102.32
R938.81
List Price:  R1,314.42
You save:  R375.60
Лв91.38
List Price:  Лв127.95
You save:  Лв36.56
₩68,890.62
List Price:  ₩96,452.39
You save:  ₩27,561.76
₪190.87
List Price:  ₪267.23
You save:  ₪76.36
₱2,881.72
List Price:  ₱4,034.64
You save:  ₱1,152.92
¥7,903.16
List Price:  ¥11,065.06
You save:  ¥3,161.90
MX$857.83
List Price:  MX$1,201.03
You save:  MX$343.20
QR182.72
List Price:  QR255.83
You save:  QR73.10
P689.81
List Price:  P965.79
You save:  P275.98
KSh6,639.79
List Price:  KSh9,296.24
You save:  KSh2,656.45
E£2,392.59
List Price:  E£3,349.82
You save:  E£957.23
ብር2,876.01
List Price:  ብር4,026.64
You save:  ብር1,150.63
Kz41,694.65
List Price:  Kz58,375.85
You save:  Kz16,681.20
CLP$47,588.94
List Price:  CLP$66,628.33
You save:  CLP$19,039.38
CN¥362.20
List Price:  CN¥507.11
You save:  CN¥144.91
RD$2,937.78
List Price:  RD$4,113.13
You save:  RD$1,175.34
DA6,709.29
List Price:  DA9,393.54
You save:  DA2,684.25
FJ$113.10
List Price:  FJ$158.35
You save:  FJ$45.25
Q389.77
List Price:  Q545.71
You save:  Q155.94
GY$10,484.28
List Price:  GY$14,678.83
You save:  GY$4,194.55
ISK kr7,005.56
List Price:  ISK kr9,808.34
You save:  ISK kr2,802.78
DH506.20
List Price:  DH708.72
You save:  DH202.52
L888.32
List Price:  L1,243.72
You save:  L355.39
ден2,874.95
List Price:  ден4,025.16
You save:  ден1,150.21
MOP$404.09
List Price:  MOP$565.76
You save:  MOP$161.67
N$945.52
List Price:  N$1,323.80
You save:  N$378.28
C$1,844.23
List Price:  C$2,582.07
You save:  C$737.84
रु6,681.04
List Price:  रु9,353.99
You save:  रु2,672.95
S/188.25
List Price:  S/263.57
You save:  S/75.31
K193.43
List Price:  K270.82
You save:  K77.39
SAR187.48
List Price:  SAR262.49
You save:  SAR75
ZK1,328
List Price:  ZK1,859.31
You save:  ZK531.30
L232.80
List Price:  L325.94
You save:  L93.14
Kč1,174.50
List Price:  Kč1,644.39
You save:  Kč469.89
Ft18,330.20
List Price:  Ft25,663.75
You save:  Ft7,333.54
SEK kr544.35
List Price:  SEK kr762.14
You save:  SEK kr217.78
ARS$43,786.41
List Price:  ARS$61,304.48
You save:  ARS$17,518.06
Bs347.54
List Price:  Bs486.59
You save:  Bs139.04
COP$198,222.27
List Price:  COP$277,527.04
You save:  COP$79,304.77
₡25,463.28
List Price:  ₡35,650.64
You save:  ₡10,187.35
L1,237.47
List Price:  L1,732.56
You save:  L495.08
₲373,144.52
List Price:  ₲522,432.19
You save:  ₲149,287.66
$U1,931.55
List Price:  $U2,704.33
You save:  $U772.77
zł201.47
List Price:  zł282.07
You save:  zł80.60
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.