I have a 5K display, but my resolution is set to 2560 x 1440.
This is an interesting problem, one that I've puzzled over in my own skins. I scale the theme images to 1920x1080, so that at least on the most common monitor size, the theme image is never subjected to browser enlargement.
So, why not scale the theme image to 2560x1440? That would produce an annoying situation for most users, who have a 1920x1080 monitor - the theme image, even on their large-ish monitors, would always be cropped (remember, it's a
background image, not a primary image, so it doesn't "resize to fit").
The best I could come up with was to default to 1920x1080 sizing of the theme image, but give the user a setting to override that, and go bigger.
Even on a double-density display, the result should be very good The user could
double the bounds, but most users don't even have original images large enough to crank out a 5120x2880 theme image, and the file size would be huge. The loading delay would be very noticeable. And there's no direct way to tell the browser to display the background image in half its actual dimensions. HTML and CSS don't provide that, so it would require a lot of finagling. Offhand, I'm not sure how it could be done.