Crisp image zoom at 150% DPI scale factor displays (Firefox 74+)

Prevents blurry anti-aliased borders between picture sampling areas ("pixels") by stretching them so they precisely match (multiples of) physical display points. Adds variable background for transparent images.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
myf
日安装量
0
总安装量
74
评分
0 0 0
版本
2.2.0
创建于
2020-06-17
更新于
2022-02-16
大小
7.7 KB
许可证
CC0 - Public Domain
适用于

!! This style makes sense only for displays with DPI zoom factor set to 150% and Firefox only !!

! For images larger than viewport you have to click it first to resize it to it's natural dimension. !

If you have display set to 150% DPI zoom factor then it is quite impossible to enjoy pixel-art as decently crisp natural squared mosaic. It is result of the fact that web content is operated in "virtual pixel" dimensions, so that virtual page pixel should be roughly same perceived size for intended view distance. That results in unfortunate effect that for most zoom levels image sampling points does not match physical display points, what produces blurry aliased edges between sampling points (a.k.a. image pixels).

This style scales images in "image only pages" (images opened directly) so they fit whole multiples physical display points again, and forces "sharp" (non-aliased) rendering producing crisp outcome.

It heavily alters scaling factors, so at any zoom level you should see crisp image. It means that zoom levels displayed by browser does not match really applied scale factor. (Again, style operates only on "naturally" sized images, i.e. after clicking large ones.)

Scope if this style is restricted to *.gif, *.png and *.ico URLS only, in order to apply it on different format or URL without suffix you can force it by adding `#crisp` to the end of the image's URL.

For a pity this technique most probably cannot work with centered images - for large scale factors anything overlapping origin of viewport would be unreachable with scroll. If you have any idea how to overcome this, kindly let me know.

Also adds variable background under transparent image: dark, light while "hovered", checkerboard while "clicked".