DEV Community

Cover image for Surprises when taking screenshots
Alexander Drozdov
Alexander Drozdov

Posted on • Updated on

Surprises when taking screenshots

I was recently generating data and storing it into image RGB channels. My favorite "debugging" tools for this task are Shift+Alt+S and paint.net. Feeding my despair, values in Color Picker were always off. After spending 3 hours triple checking my vector math that generated data, I decided to "Save images as...", opened it, and everything was correct. It was time to figure out what was going on with the rendering in the browser.

I created a completely green image, and in the table you can see what I expected when I took the screenshot and what I actually got.

Image CSS background
Expected (paint.net) 0, 255, 0 0, 255, 0
Chrome and Edge 34, 255, 42 34, 255, 42
Firefox 32, 255, 39 0, 255, 0
Windows Photos 32, 255, 39 n/a

It is quite simple, I have a custom ICC profile for the main screen. In my mental model, this kind of post-processing should be happening OS wide in compositor, so screenshots are not affected (similar to Night light).

My mental model

The reality is, every application is responsible to be color space aware individually. Browsers are aware, although for some reason colors in Chrome are different, Firefox applies it only to images.

Right now, I'm using a flag that forces Chrome to render in sRGB.

Force color profile

Top comments (0)