When viewing a raster image, all more or less recent Mozilla products (e. g.: Firefox and SeaMonkey) transform it into a full HTML document, e. g.:
<html>
<head>
<meta name="viewport" content="width=device-width; height=device-height;">
<link rel="stylesheet" href="resource://gre/res/ImageDocument.css">
<link rel="stylesheet" href="resource://gre/res/TopLevelImageDocument.css">
<link rel="stylesheet" href="chrome://global/skin/media/TopLevelImageDocument.css">
<title>googlelogo_color_272x92dp.png (PNG Image, 544 × 184 pixels)</title>
</head>
<body>
<img src="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png" alt="https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png">
</body>
</html>
The content of the default CSS styles can be viewed here:
resource://gre/res/ImageDocument.css
resource://gre/res/TopLevelImageDocument.css
chrome://global/skin/media/TopLevelImageDocument.css
The problem is, on HiDPI displays, low-resolution images often get up-scaled (for instance, on a 4k display they're enlarged by a factor of x1.5).
Which extra styles do I need to apply to the generated HTML in order for images to be always displayed in their original size (i. e. 1:1)?
I'm looking for the proper way to customize either userContent.css
or userChrome.css
.
More on userChrome.css
: