Adjusting the Image Contrast using CSS3

To set image contrast in CSS, use filter contrast(%). Remember, the value 0 makes the image black, 100% is for original image and default. Rest, you can set any value of your choice, but values above 100% would make the image with more contrast.


Let us now see an example to adjust image contrast with CSS3 −

 Live Demo

<!DOCTYPE html>
img.demo {
   filter: brightness(120%);
   filter: contrast(120%);
<h1>Learn MySQL</h1>
<img src="" alt="MySQL" width="160" height="150">
<h1>Learn MySQL</h1>
<p>Below image is brighter and has more contrast than the original image above.</p>
<img class="demo" src="" alt="MySQL" width="160" height="150">