Contrast Filter

4 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 in this movie, we are talking about contrast function in CSS image filters, which allows you to adjust the contrast of the image. So here's the demo. This is the original image, and we have 100%. Contrast, and 100% is the default value for this contrast function. But what happens if we go beyond 100% or over 100%? Well, it's only going to give you more contrast it reserved like this.

This had 200% contrast, which is two times more than this original image. But what happens if you go below 100%? Well, if you go below 100%, you will going to get this darker result. So hundred percent is the default value of contrast, if you go beyond 100%, you will get this a high contrast. And if you go below 100%, you will get this darker result. But before showing you this contrast function in action, let me just tell you, that what kind of value you can pass as a parameter in this contract function.

Well, here's a contrast function. And you can pass a number or percentage value as a parameter in this contrast function. So now let me just go to my quatre where and show you this contrast function in action. So here am I on my quatre. And we're going to work on this last two images, which have a class of image two and image three, then we go to this filter under CSS, I just go to image, and I'm gonna use this filter property. And now this time, I'm going to make use of this contrast function.

Now what happens if I don't pass any value, as I told you, if you do not pass any value here, it will automatically going to assume that this is the hundred percent contrast, which means our image will remain unchanged. So let me show you you see this second image and this image is remained unchanged. Well, that's because it's already have 100% contrast by default. So let me just go here. And let me just copy this one and I'm going to paste it right here. And here, I'm going to pass hundred percent and now what's gonna happen Again, the 30 minutes is going to remain unchanged.

Because again, we are saying that hundred percent contrast rate, which is already it is right. So that's why it's going to remain unchanged. So hundred percent is a default well, but what happened, if we go below 100%. In this case, let's make it zero percent. If I save it, you see that our 30 minutes is going to be a kind of a blackish. Right?

It's a darker isn't it, I'm going to make it complete black. But let me just go here, and let's make it 50% contrast. So if I just do that, you see that we'll still get this blackest result, you see this I have 100% contrast and as you go below hundred percent, you will get this blackish result. So what happens if you go beyond hundred percent? Obviously, you're gonna get more contrast. So let me show you if I go here, and let's make it hundred 50% right.

And this is one is actually a little make it 200%. Right? If I save it, if I go here, you see that now we have more contrast. They said, so. So this is the original image which have 100% contrast, then we have this 150% contrast. And then we have this 200% contrast, which is super high.

Again, you can go crazy, and you can make some tea like, you know, 500% obviously, you do not want that kind of contrast, maybe you want for some cases, but you know, it's totally up to you, you can go as much as you want. So this is extremely powerful, just like other citizens image filter functions, you can pass to kind of value as a parameter, which is percent and the number. So if you want to find a percent, just make it five, if you want 150 just make it 1.5. If I go here, you will not see any changes because it's remained unchanged. It's again, only 20% and 500%. And we have exact same value here.

So let's make it you know, 200% and if I go here, okay, this 100% 200% and 500%. And again, just like a most offices filter function, This also cannot accept any negative value. So if you pass it, you say you just lose all your filters. So that's why just make sure you do not pass a negative value here. So let me just go here. This is how you can adjust the contrast of the image using contrast 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.