I just installed Ubuntu 20.04 on my work computer yesterday and have noticed that the colors in my Julia plots come out differently depending on whether I view them within VSCode/Jupyter, as a .png export, or as a .pdf export.
I’m not sure where in the stack the problem comes from, so I am posting here in hopes that someone has seen something similar. Is the issue most likely to be with Julia, Plots, Ubuntu, the Image Viewer Program in Ubuntu, my display configuration, or something else?
In my (limited) experience there are many things that have to go right before colors display correctly.
Here is some test code:
using Plots
plot(rand(200), c=:dodgerblue)
savefig("test.png")
savefig("test.pdf")
The plot displayed in VSCode looks like this.
test.png displayed in Image Viewer looks like this.
I think the usual reasons are that different programs have different color management, so some respect color space information in image sources and some assume general properties which aren’t necessarily true. The different formats png and pdf could definitely have different color spaces, or maybe one of them had no color space information written to it and a generic space like the one you have set system wide is assumed.
Color differences usually present most clearly in saturated colors as those are at the edges of color spaces and are most affected by shifts.
I would try and look up programs with which you can query the color space information embedded into your files, and google if your programs are color managed or not.
Zoom experiments suggest that color management is the most likely culprit. But it seems odd that VSCode and the Ubuntu image viewer would have the same problem, unless they share a common backend, but then it would be weird for them to have a common backend not shared by Firefox.
Now that color management is widespread (even on Linux), color management problems often depend on having a consistent configuration, not on having a common backend.
Modern browsers such as Firefox and Chromium-based applications have their own color management systems. Usually, they refer to the profile settings of the OS or window manager, but for some reason they seem to be inconsistent.
Empirically, I guess the VSCode and the Ubuntu image viewer manage the colors to fit a wide gamut of color profiles (maybe properly), and Firefox does not. However, only you can know what colors are displayed on your display, so without profile data I cannot know what is ”correct".