4K devices are becoming more popular. I am developing a website and I have a mobile phone that has a UHD display. I noticed that the images are blurry. I immediately thought could it be that fact it was 4K. By doubling the image size as shown in the examples below I found that it was not blurry anymore.
4K/UHD:<img src="/images/logo-192x128.png" width="96" height="64" />
Standard HD/SD:<img src="/images/logo-96x64.png" width="96" height="64" />
My question is, how can you detect a 4K/UHD display using JavaScript so that you can dynamically include the double-resolution images when a 4K display is detected. The reason I want to do this is to cut down on my pages' load times as loading these larger resolution images is resource intensive.