To solve this problem, and using the brightness
filter, we can use the clip property:
The clip property allows you to specify a rectangle to
cut an element absolutely positioned. The rectangle is
specified as four coordinates, all from the upper
left of the element to be cut.
As I did not read the question right, I did the inverse that you asked for, ie, the filter range has brightness
:
.brightness div{
position:absolute;
overflow:hidden;
}
#filter img{
-webkit-filter:brightness(200%);
filter:brightness(200%);
}
#filter{
position:absolute;
clip: rect(30px, auto, 90px, auto);
/* (top, right, bottom, left) */
}
<div class="brightness">
<div id="original">
<img src="https://image.freepik.com/fotos-gratis/laptop-na-mesa-do-escritorio_426-19315253.jpg"></div><divid="filter">
<img src="https://image.freepik.com/fotos-gratis/laptop-na-mesa-do-escritorio_426-19315253.jpg"></div></div>
I'vedonewhatyouwanttodo:
.brightness div{
position:absolute;
overflow:hidden;
}
#noFilter{
position:absolute;
clip: rect(30px, auto, 90px, auto);
/* (top, right, bottom, left) */
}
#original img{
-webkit-filter:brightness(200%);
filter:brightness(200%);
}
<div class="brightness">
<div id="original">
<img src="https://image.freepik.com/fotos-gratis/laptop-na-mesa-do-escritorio_426-19315253.jpg"></div><divid="noFilter">
<img src="https://image.freepik.com/fotos-gratis/laptop-na-mesa-do-escritorio_426-19315253.jpg">
</div>
</div>