Proposal - dim images with opacity
See original GitHub issueWhat is the Proposal?
Add dimming to images.
Why?
When browsing the web at night, often times you’ll run into images that have white or very bright backgrounds and are not png’s. Imagine browsing websites (example e-commerce/shopping) where they use large white backgrounds.
Solution
- Dim images slightly.
- Add a configurable option to toggle this feature on/off.
Potential Challenges
- jpg’s or images that don’t have bright backgrounds could become hard to read. I haven’t dug into how to solve that issue too much, but I know there are micro javascript libraries that can detect the color of images and analyze the brightness level, if we were to use something like that, we could check the brightness of the image after loading the page, to undo dimming, if the image doesn’t need to be dimmed.
CSS filters have strong support already. Most users who use dark reader, we can assume are on relatively newer browsers. If they know how to install an extension and find one like dark reader, we can make some assumptions =).
img {
border-color: #000;
box-shadow: none;
-webkit-filter: brightness(0.8) contrast(1.2);
filter: brightness(0.8) contrast(1.2);
}
Live demo code (JSbin.com): https://jsbin.com/naseresade/4/edit?html,output
Issue Analytics
- State:
- Created 4 years ago
- Reactions:11
- Comments:5
Top Results From Across the Web
How do I give text or an image a transparent background ...
No transparent PNG images are required. Use :before (or :after ) in CSS and give them the opacity value to leave the element...
Read more >How to use transparency in graphic design - Canva
In this article, we deep dive into a core design principle: Transparency. ... You could create depth by using a more transparent photo...
Read more >11 Design Tips to Make Text Over Images More Readable
The image in the background is such that if some part of it is blocked by text and transparent shape, the slide becomes...
Read more >Deep Image Matting. The tech behind EraseBG - Rahul Deora
Both these images are input to the DIM model. The third and fourth columns are the predicted alpha mattes of a classical method,...
Read more >Deep Image Matting - arXiv
cently proposed deep learning methods are highly reliant on ... learn an alpha matte end-to-end given an image and trimap.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes! Indeed, this stunning extension has saved my eyes more than once by nights! It would be great to have this functionality, albeit as an implicit setting.
In the meantime, I am using such a simple code that I pasted into the
config editor
.Hovering over an element returns the brightness so that you can better understand the context 👍
so are browser extensions 😉
Actually CSS filters run on the GPU.