Pixel-perfect integer-ratio scaling with no blur

a.k.a. integer scaling

Summary Issue Full HD on a 4K monitor looks worse than on a Full-HD monitor. This happens due to blur added by all monitors and absolute majority of TVs at any scaling ratio, though this could be avoided when enlarging by an integer number of times (e. g. 2 in case of FHD→4K). As a result, sharpness in 3D games is decreased, white lines are gray, and pixel art is not pixel art anymore. Solution Each logical pixel could be displayed as a square group of integer (2×2, 3×3) number of physical pixels of the same color without mixing-in colors of adjacent pixels. Such lossless scaling is already built into graphics drivers and removes blur regardless of monitor or TV used. But scaling via graphics card (GPU) cannot help if the signal source is not a computer, but e. g. a video player or a game console. Also, GPU scaling wastes bandwidth of video interface (HDMI, DP). This may sacrifice refresh rate and color depth. Live demo Algorithm Get involved Complain of blur to technical support of your monitor/TV manufacturer.

Ask about support for nonblurry scaling in comments to reviews of monitors and TVs in mass media.

Request the feature for game engines that don’t have it.

Tell about the issue to as many people as possible. Petition Progress AMD: supported for GPUs based on the 2nd-generation GCN ( 2013 ) and newer architectures in Radeon Software 2020 (19.12.2+) ( 2019-12-10 ) for Windows 7/10; being implemented for Linux.

supported for GPUs based on the 2nd-generation ( ) and newer architectures in Radeon Software 2020 (19.12.2+) ( ) for Windows 7/10; being implemented for Linux. Intel: supported for Gen11 GPUs in the driver 25.20.100.7155+ ( 2019-08-30 ) for Windows 10; available since September 2019 in laptops equipped with Gen10 CPUs based on the Ice Lake architecture.

supported for Gen11 GPUs in the driver 25.20.100.7155+ ( ) for Windows 10; available since in laptops equipped with Gen10 CPUs based on the Ice Lake architecture. nVidia: supported with limitations for RTX and GTX 16* in the driver 436.02+ ( 2019-08-20 ) for Windows 10; incompatible with HDR, custom resolutions, DSR, 4:2:0, sharpening, and hybrid-GPU laptops.

supported with limitations for RTX and GTX 16* in the driver 436.02+ ( ) for Windows 10; incompatible with HDR, custom resolutions, DSR, 4:2:0, sharpening, and hybrid-GPU laptops. Linux: supported in Proton 4.11-10+ ( 2019-12-13 ) (used in Steam Play); limited support in XRandR 1.5.1+ ( 2019-08-12 ) and nVidia graphics driver 384.47+ ( 2017-06-29 ): image is cropped in many games.

supported in ( ) (used in Steam Play); limited support in XRandR 1.5.1+ ( ) and nVidia graphics driver 384.47+ ( ): image is cropped in many games. Monitors: announced for the 27″ QHD and 4K monitors Eve Spectrum based on LG IPS panels with HDR support and refresh rates up to 144 (QHD, 4K) and 240 Hz (QHD); expected in Q3 and Q4 2020 ; preorder is available.

What scaling is

The image on computer monitors and TVs consists of pixels. The number of pixels in horizontal and vertical directions is called resolution.

Scaling is resizing (changing resolution of) an image. It is needed if native (physical) resolution of the display (a monitor or a TV set) is different from the resolution of the video signal it receives: e. g. if a game at a resolution of 1920×1080 (Full HD) is running in full-screen mode on a monitor with a native resolution of 3840×2160 (4K).

The issue — blur

With all monitors, most of TVs and many graphics cards (GPUs) of previous generations, scaling leads to losing sharpness at any scaling ratio. Such sharpness loss is perceived as blur and is irreversible quality loss.

But actually, blur is only inevitable if the monitor resolution is not a multiple of the signal resolution. For example, it’s impossible to display one logical pixel as 1.5×1.5 physical pixels, so we are forced to use interpolation that calculates average colors of adjacent pixels of the image to scale.

The solution — integer-ratio scaling

If the scaling ratio is not fractional (e. g. 1.5), but integer (e. g. 2 or 3), the blur can be avoided just by displaying each logical pixel as a square group of an integer (e. g. 2×2 or 3×3) number of physical pixels of the same color — i. e. just by duplicating the corresponding pixel of the original image multiple times without affecting it with colors of adjacent pixels.

Such lossless scaling is known as integer (integer-ratio, integer-factor, integral) scaling, pixel-perfect scaling, and pixel doubling (duplication).

More than Nearest Neighbour

The “Nearest Neighbour” interpolation is only lossless at integer ratios of sizes of resulting and original images, but results in distortion at fractional ratios due to different pixel sizes:

Integer-ratio scaling is always lossless because scaling ratio is always integer and all pixels always have the same size. Blur can be avoided even if resolutions of display and image are not divisible: it’s enough to scale with an integer ratio so that the image fills the screen as fully as possible, and fill the rest screen space with black background the same way as when the image is centered on the screen with no scaling.

For example, we can display a 1280×1024 image on a 3840×2160 screen by displaying each image pixel as a group of 4 (2×2) identical physical pixels with black margins of 56 physical pixels above and below, and 640 pixels — leftward and rightward.

Examples

Pixel art

The differences between blurry bilinear interpolation and lossless integer-ratio scaling are clearly evident on a pixel-art image:

Photos

See also the photos of the same screenshot of the Reaper application taken using the three scaling methods:

Live demo

For better understanding of what nonblurry integer-ratio scaling is, see the web-based live demo. It allows to compare an image scaled with an integer ratio with no blur and a regular blurry image. It also supports viewing custom images, aspect-ratio correction, and scanlines.

Use cases

Working at a resolution lower than native display resolution makes sense for the following purposes:

performance boost in modern 3D games, especially on laptops;

ability to use 4K+ displays to play games not intended for HiDPI displays: games that don’t scale their user interface; games that work incorrectly at 4K+ resolutions;

with nonblurry scaling — maintaining pixelation in old and pixel-art games;

decreasing power consumption and heat of the computer: decreasing noise of the graphics-card cooler; energy saving; speeding down environment pollution.



Why it’s important

With 4K monitors of 24—27″ size at Full HD resolution, single image pixels are almost indistiguishable, so blur does not add any smoothing and just senselessly decreases sharpness resulting in an unreasonable quality loss.

Integer-ratio scaling by pixel duplication should work much faster than bilinear or bicubic interpolation, so using integer-ratio scaling could decrease or remove a lag introduced by scaling.

User has a right not to have unreasonable quality loss when working at resolutions different from the native display resolution.

A faster graphics card has a higher heat emission ( TDP ) and increased cooler noise. This has a negative impact to user comfort, and may result in irreversible diminished hearing in the long term. This also applies to a graphics card that has its computational power utilized to a higher degree than could be at a lower resolution.

) and increased cooler noise. This has a negative impact to user comfort, and may result in irreversible diminished hearing in the long term. This also applies to a graphics card that has its computational power utilized to a higher degree than could be at a lower resolution. A faster graphics card does not solve the issue entirely since the issue is not just about performance (see below).

Even more important with higher native resolution

The higher native (physical) display resolution is, the more important and effective integer-ratio scaling gets.

At a higher resolution, it’s harder to achieve comfortable performance in games. The 4K resolution is 4 times higher than Full HD. The 8K (7680×4320) resolution is another 4 times higher.

On a display with a higher native resolution, a logical pixel is less noticeable at the same display size and scaling ratio, so blur as a sort of smoothing gets even less reasonable. For example, a pixel on a 4K monitor can still be noticeable at the Full HD (1920×1080) resolution at a certain combination of the display size, the viewing distance and antialiasing quality in the game. But with the physical resolution of 8K and the signal resolution of 4K, logical pixel will be totally indistinguishable under typical conditions.

A higher native display resolution typically allows to use screen fuller when using integer-ratio scaling. For example, at the 320×240 resolution typical for DOS games, just 89% of the height of a Full HD (1920×1080) display is used (used 960 of 1080 pixels with the ratio of 4), while the height of a 4K monitor is used entirely (scaling ratio is exactly 9). Original resolution Resolution after scaling Note FHD 4K 8K Ratio Height loss Ratio Height loss Ratio Height loss 256×224

SNES 4.8 17% 9.64 6.7% 19.3 1.5% On 4K, height loss is 2.6 times smaller than on FHD. On 8K — 4.5 times smaller than on 4K and 11.5 times smaller than on FHD 320×240

qVGA 4.5 11.1% 9 0 18 0 640×480

VGA 2.25 11.1% 4.5 11.1% 9 0 Same height loss on FHD and 4K 800×600

SVGA 1.8 44.4% 3.6 16.7% 7.2 2.8% On FHD, fits only at 100% zoom (no zoom). On 4K, height loss is 2.67 times smaller than on FHD; on 8K — 6 times smaller than on 4K, and 16 times smaller than on FHD 1024×768

XGA 1.4 28.9% 2.81 28.9% 5.63 11.1% On FHD, fits only at 100% zoom (no zoom). On 8K, height loss is 2.6 times smaller than on 4K and FHD

A higher native display resolution allows to use screen even fuller by using variable-size logical pixels with a size difference of 1 physical pixel. The more physical pixels logical pixel contains, the less noticeable the difference of 1 physical pixel is. For example, for the resolution of 256×224 typical for 16-bit game consoles such as SNES and Genesis, the maximum integer ratio on a Full HD display is 4 (the full fractional ratio is 4.82), so 184 pixels are lost vertically by default, or 17% of the screen height. But if we increase the height of every second logical pixel by 1 physical pixel (4×5 instead of 4×4), then the lost height will decrease by 2.5 times — just 72 physical pixels will be lost, or 7% of the screen height. (For maintaining image aspect-ratio, image width should also be proportionally increased.) But the difference of 25% in height of pixels in adjacent lines on an FHD display can be noticeable. On a 4K display, the relative increase of pixel height is just 11% (9×9 → 9×10) and therefore much less noticeable. On a 8K display under similar conditions, the pixel-height difference is just 5% (19×19 → 19×20), while pixel-height increase in every 4th line decreases lost height by 8 times — from 64 to 8 pixels.

On 8K displays, integer-ratio scaling allows to use with no loss of quality or screen space, any of the typical resolutions: 4K (3840×2160, 2x); QHD (2560×1440, 3x); FHD (1920×1080, 4x); HD (1280×720, 6x).



Faster GPU is not a solution

There are cases when using a higher-performance graphics card cannot help:

if a high-pixel-density display is installed into a laptop, installing a powerful graphics card is virtually impossible due to natural limitations in terms of space, power consumption and heat dissipation;

many games contain bitmap elements ( e. g. menu in “Half-Life 2” and toolbars in “Cities XL Platinum”) which get small at 4K resolution, making the game almost unplayable;

menu in 2” and toolbars in “Cities XL Platinum”) which get small at 4K resolution, making the game almost unplayable; some games work incorrectly at 4K resolution ( e. g. in the “Bionic Commando Rearmed” game, conundrum elements are invisible in “Hack enemy network” sublevels);

in the “Bionic Commando Rearmed” game, conundrum elements are invisible in “Hack enemy network” sublevels); some games ( e. g. “Duck Tales Remastered”) have a fixed resolution ( e. g. Full HD) while support for other resolutions is achieved via blurry scaling;

“Duck Tales Remastered”) have a fixed resolution ( Full HD) while support for other resolutions is achieved via blurry scaling; in games based on pixel art, performance is not an issue, and the important thing is pixelated nature of the image with no inappropriate blur not matching the intention of the game authors.

Partial solutions

Scaling software

For scaling Windows games that support windowed mode, the free IntegerScaler utility for Windows 7+ can be used.

utility for Windows 7+ can be used. For scaling 3D games, the GeDoSaTo application can be used (source code is available). Drawbacks: only supports relatively old games that use DirectX 9 or older; works with just some of them; on some systems, modern versions of the application don’t work at all, yours truly was able to use successfully one of its previous versions — Beta 10 Poltergeist.



Wrappers for Glide and DirectX

Glide is the API behind 3dfx graphics accelerators. Glide wrappers allow to play Glide-powered games on computers supporting modern DirectX and OpenGL APIs.

The Glide wrapper (emulator) nGlide since the version 2.10 ( 2019-06-19 ) supports nonblurry integer-ratio scaling (Options → Aspect ratio → Integer scaling).

since the version 2.10 ( ) supports nonblurry integer-ratio scaling (Options → Aspect ratio → Integer scaling). DgVoodoo (Glide emulator and DirectX wrapper) and DXGL (OpenGL implementation of DirectDraw) reportedly support the nonblurry scaling algorithm “Nearest Neighbour” (sources: 1, 2).

Game-console emulators and old-game engines

SNES (Super Nintendo, Super Famicom)

The SNES emulator Snes9x since the version 1.56.2 ( 2018-06-22 ) supports integer-ratio scaling (Video → Display Configuration (Display Settings) → General → Integer Scaling). To prevent blur, uncheck the Video → Bilinear Filtering checkbox, and to prevent other distortions of original image, set both dropdowns Video → Display Configuration (Display Settings) → Output Image Processing to None. Output method (Video → Display Configuration (Display Settings) → General → Output Method) must be set to “Direct3D” or “OpenGL”; the feature does not work in the “DirectDraw” mode. Limitation: when using the “Scanlines” filter, an even scaling ratio is forced, so screen height may be used less entirely than without the filter: for example, on a 4K monitor, the ratio used is 8 instead of 9.

emulator since the version 1.56.2 ( ) supports integer-ratio scaling (Video → Display Configuration (Display Settings) → General → Integer Scaling). To prevent blur, uncheck the Video → Bilinear Filtering checkbox, and to prevent other distortions of original image, set both dropdowns Video → Display Configuration (Display Settings) → Output Image Processing to None. Output method (Video → Display Configuration (Display Settings) → General → Output Method) must be set to “Direct3D” or “OpenGL”; the feature does not work in the “DirectDraw” mode. Limitation: when using the “Scanlines” filter, an even scaling ratio is forced, so screen height may be used less entirely than without the filter: for example, on a 4K monitor, the ratio used is 8 instead of 9. The SNES emulator Snes9x EX+ for Android since the version 1.4.4 ( 2011-09-21 ) supports integer-ratio scaling (Options → Video → Zoom → Integer-only). To prevent blur, switch the Options → Video → Image Interpolation option to the None value instead of the default Linear value.

emulator for Android since the version 1.4.4 ( ) supports integer-ratio scaling (Options → Video → Zoom → Integer-only). To prevent blur, switch the Options → Video → Image Interpolation option to the None value instead of the default Linear value. The SNES emulator Mesen-S supports integer-ratio scaling: Options → Video → General → Use integer scale values when entering fullscreen mode. To prevent blur, the checkbox Picture → Use bilinear interpolation when scaling should be unchecked (unchecked by default). The emulator supports precise per-side cropping of the original image, which allows to utilize screen space fuller: Options → Video → Overscan.

emulator supports integer-ratio scaling: Options → Video → General → Use integer scale values when entering fullscreen mode. To prevent blur, the checkbox Picture → Use bilinear interpolation when scaling should be unchecked (unchecked by default). The emulator supports precise cropping of the original image, which allows to utilize screen space fuller: Options → Video → Overscan. The SNES emulator bsnes-mt (improved version of bsnes) for Windows has the “Pixel-Perfect” mode: Settings → Output → Pixel-Perfect. Unlike the “Center” mode in original bsnes, scaling ratios in the “Pixel-Perfect” mode in bsnes-mt are integer both vertically and horizontally, even with aspect-ratio correction enabled. Thanks to this, all pixels have exactly the same size, so there is no pixel shimmering (a.k.a. ripple effect, or jitter). Also, the user interface of bsnes-mt is available in Russian (English is also available), and screen­shots are saved in the compressed PNG format instead of BMP.

emulator (improved version of bsnes) for Windows has the “Pixel-Perfect” mode: Settings → Output → Pixel-Perfect. Unlike the “Center” mode in original bsnes, scaling ratios in the “Pixel-Perfect” mode in are integer both vertically and horizontally, even with aspect-ratio correction enabled. Thanks to this, all pixels have exactly the same size, so there is no pixel shimmering (a.k.a. ripple effect, or jitter). Also, the user interface of is available in Russian (English is also available), and screen­shots are saved in the compressed PNG format instead of BMP. In the SNES emulator bsnes since the version 107 ( 2019-02-22 ), the “Center” mode (Settings → Output → Center) automatically uses integer-ratio scaling. To prevent blur, switch the Settings → Shader option to the None value instead of the default Blur value. Limitation: when using the “Scanlines” filter at an odd scaling ratio ( e. g. 9 at the 4K native resolution) in conjunction with the rendering backend “OpenGL 3.2” (Settings → Drivers → Video → Driver), scanlines are rendered unevenly: for example, on a 4K monitor, each 7th line is thicker by 1 pixel than other scanlines.

NES (Nintendo, Famicom)

The NES emulator Mesen since the version 0.9.1 ( 2017-08-06 ) supports integer-ratio scaling: Options → Video → General → Use integer scale values when entering fullscreen mode. To prevent blur, the checkbox Picture → Use bilinear interpolation when scaling should be unchecked (unchecked by default). The emulator supports precise per-side cropping of the original image, including per-game settings, which allows to utilize screen space fuller: Options → Video → Overscan.

emulator since the version 0.9.1 ( ) supports integer-ratio scaling: Options → Video → General → Use integer scale values when entering fullscreen mode. To prevent blur, the checkbox Picture → Use bilinear interpolation when scaling should be unchecked (unchecked by default). The emulator supports precise cropping of the original image, including settings, which allows to utilize screen space fuller: Options → Video → Overscan. The NES emulator puNES since the version 0.105 ( 2019-07-30 ) supports integer-ratio scaling: Settings → Video → Misc → Use integer scaling in full­screen. To prevent blur, uncheck the Interpolation checkbox.

Game Boy, Game Boy Advance

mGBA — the emulator of portable game systems Game Boy, Game Boy Color and Game Boy Advance — since the version 0.6 ( 2017-07-16 ) supports integer-ratio scaling: Audio/Video → Force integer scaling. To prevent blur, the checkbox Audio/Video → Bilinear filtering should be unchecked (unchecked by default).

— the emulator of portable game systems Game Boy, Game Boy Color and Game Boy Advance — since the version 0.6 ( ) supports integer-ratio scaling: Audio/Video → Force integer scaling. To prevent blur, the checkbox Audio/Video → Bilinear filtering should be unchecked (unchecked by default). SameBoy — an emulator of the portable game systems Game Boy and Game Boy Color — since the version 0.9 ( 2017-05-27 ) supports integer-ratio scaling (Graphic Options → Scaling Mode → Retain Integer Factor). To prevent blur, make sure the option Graphic Options → Scaling Filter is set to the Nearest Neighbor value. The emulator is formally not DPI-aware at least under Windows, so to ensure nonblurriness and maximum screen-space utilization, it’s recommended to disable DPI scaling in its executable-file properties.

Multi­system emulators

The RetroArch frontend for game-console emulators supports integer-ratio scaling (Settings → Video → Integer Scale). To prevent blur, set the Settings → Video → Bilinear Filtering parameter to the Off value.

frontend for game-console emulators supports integer-ratio scaling (Settings → Video → Integer Scale). To prevent blur, set the Settings → Video → Bilinear Filtering parameter to the Off value. The BizHawk frontend for game-console emulators supports integer-ratio scaling (Config → Display → Scaling & Filtering → Expand pixels by integers only (e.g no 1.3333x)). To prevent blur, set the Final Filter parameter to the None value (default). But sometimes aspect ratio is wrong and pixel proportions are distorted.

frontend for game-console emulators supports integer-ratio scaling (Config → Display → Scaling & Filtering → Expand pixels by integers only (e.g no 1.3333x)). To prevent blur, set the Final Filter parameter to the None value (default). But sometimes aspect ratio is wrong and pixel proportions are distorted. The emulator of multiple game systems and old computers MAME supports integer-ratio scaling with no blur. Integer-ratio scaling can be enabled with the command-line parameter -no u n e ven s tretch or its short version -noues . Blur can be disabled with the command-line parameter -nofilter , or by setting the option Configure Options → Video Options → Bilinear Filtering in MAME settings to the Off value. The algorithm of integer-ratio scaling in MAME uses pixels of the same size, so at low scaling ratios, aspect ratio of the scaled image may be inaccurate if the game needs aspect-ratio correction. For example, in the arcade version of the “Mortal Kombat 3” game (the original resolution is 400×254, target aspect ratio is 4:3) the scaled image is noticeably too narrow horizontally on FHD displays (logical-pixel size is 3×4 physical pixels, an error is 11.42%), while such disproportion is unnoticeable on 4K displays (pixel size is 7×8, an error is 3.34%).

The emulator of 8/16-bit game consoles higan since the version 104 ( 2017-08-12 ) supports integer-ratio scaling (Settings → Video → Windowed Mode / Fullscreen Mode → Integral scaling). To prevent blur, uncheck the Settings → Video Emulation → Blurring checkbox, and switch the Settings → Video Shader option to the None value instead of the default Blur value.

since the version 104 ( ) supports integer-ratio scaling (Settings → Video → Windowed Mode / Fullscreen Mode → Integral scaling). To prevent blur, uncheck the Settings → Video Emulation → Blurring checkbox, and switch the Settings → Video Shader option to the None value instead of the default Blur value. The emulator of multiple game systems and old computers Mednafen supports integer-ratio scaling. Mednafen is a console application with no built-in GUI . To enable integer scaling, in the mednafen.cfg file, set the *.stretch parameter for the emulated system to the aspect_int value. To enable aspect-ratio correction, set *.correct_aspect to 1 . To prevent blur, make sure that *.videoip is set to 0 (default). For example, for SNES: snes.stretch aspect_int

snes.correct_aspect 1

snes.videoip 0

Other emulators

DuckStation — an emulator of the Sony PlayStation (PSX) game console — supports integer-ratio scaling. The application is available in two versions: with user interface based on Qt and SDL libraries. In Qt version: Settings → GPU Settings → Screen Display → Integer Upscaling; to prevent blur, uncheck the Linear Upcaling checkbox and make sure the checkbox Enhancements → Bilinear Texture Filtering is unchecked (unchecked by default). In SDL version: Settings → GPU → Integer Scaling; to prevent blur, uncheck the Linear Filtering checkbox and make sure the checkbox Texture Filtering is unchecked (unchecked by default).

Cemu — an experimental emulator of the Wii U game console for Windows — since the version 1.15.2 ( 2019-02-04 ) supports the “Nearest Neighbour” scaling algorithm (Options → General settings → Graphics → Upscale filter / Downscale filter → Nearest Neighbor). A custom resolution can be set on per-game basis via graphic packs (Options → Graphic packs).

— an experimental emulator of the Wii U game console for Windows — since the version 1.15.2 ( ) supports the “Nearest Neighbour” scaling algorithm (Options → General settings → Graphics → Upscale filter / Downscale filter → Nearest Neighbor). A custom resolution can be set on basis via graphic packs (Options → Graphic packs). The Amiga emulator WinUAE supports integer-ratio scaling: “Settings” → “Host” → “Filter” → the dropdown in the 3rd row, 3rd column → “Integer scaling” or “Auto Integer scaling”.

supports integer-ratio scaling: “Settings” → “Host” → “Filter” → the dropdown in the 3rd row, 3rd column → “Integer scaling” or “Auto Integer scaling”. ScummVM, a modern environment for running multiple old games like “Broken Sword”, since the version 2.1 ( 2019-10-05 ) supports integer-ratio scaling: “Options” → “GFX” → “Stretch mode” → “Pixel-perfect scaling”. Blur can be disabled by unchecking the “Filter graphics” checkbox. There is also built-in scaling with the fixed integer ratios of 2x (200%) and 3x (300%) in windowed mode: “Options” → “GFX” → “Graphics mode”), but the global setting only applies to games with resolutions up to 320×240, while for games with higher resolutions, this should be specified per-game: “Edit Game” → “Graphics” → “Override global graphic settings”. The application is formally not DPI-aware, so to ensure nonblurriness and maximum screen-space utilization, it’s recommended to disable DPI scaling in its executable-file properties. In the graphics mode “OpenGL”, the app may switch 4K monitor to the Full HD resolution that may cause blur due to scaling by monitor or by GPU. A workaround is switching the app to a different graphics mode — e. g. “3x”. ScummVM is also available as a libretro core that can be used with frontends like RetroArch or BizHawk which have their own integer-scaling implementations.

OS virtualization

For running DOS applications — the DOSBox ECE emulator — an improved unofficial version of the DOSBox program with support for nonblurry integer-ratio scaling. Starting with the version r4318 ( 2020-02-10 ), the feature is temporarily unavailable, the latest version with support for pixel-perfect integer-ratio scaling is r4301 ( 2019-12-11 ). Unlike the regular DOSBox, the ECE version features true scaling not based on filters, so nonblurry scaling in full-screen mode is supported, and scaling ratio is calculated automatically and not limited to low values (3x in the official DOSBox). A value of openglpp or surfacepp should be used for the output parameter in the [sdl] section of the configuration file ( *.conf ) for the game, or the parameter should not be specified at all. To disable aspect-ratio correction (e. g. for stretching 320×200 to the height of 240 corresponding to the ratio of 4:3) and switching to perfect square pixels, use the aspect=false parameter in the [render] section of the configuration file. Vertical synchronization (V-Sync) at output=openglpp can be enabled with the glfullvsync=true parameter in the [sdl] section. For more details, see the readme for the pixel-perfect patch included also in the DOSBox ECE distribution ( README for pixel-perfect patch.txt ). An example of DOSBox ECE configuration file for the “Epic Pinball” game: [sdl]

fullscreen=true

output=openglpp

glfullvsync=true



[cpu]

cycles=4000



[autoexec]

mount C "."

C:

cd \EPICPIN

PINBALL.EXE

exit

For running DOS games, another DOSBox variant can be used — DOSBox-staging , that supports nonblurry integer-ratio scaling based on an implementation by the author of the patch used in DOSBox ECE. Compared with DOSBox ECE, performance of DOSBox-staging is lower. As a value of the output parameter in the [sdl] section of the configuration file ( *.conf ) for the game, texturepp should be used. The scaler and glshader parameters in the [render] section should be set to the none value. An example of DOSBox-staging configuration file for the “Epic Pinball” game: [sdl]

fullscreen=true

output=texturepp



[render]

scaler=none

glshader=none



[cpu]

cycles=4000



[autoexec]

mount C "."

C:

cd \EPICPIN

PINBALL.EXE

exit

The virtualization environment VirtualBox supports nonblurry scaling of the virtual machine’s screen in the range of 100–300%: Machine → Settings → Display → Screen → Scale Factor.

Scaling built into games

Nonblurry scaling is built into some modern games. This is typically available in pixel-art games, but some 3D games have the feature too.

Nonblurry scaling is built into the Owlboy game ( 2016 ) (an adventure platformer based on pixel art).

game ( ) (an adventure platformer based on pixel art). Nonblurry integer-ratio scaling is built into the QuakeSpasm game (a Quake version powered by a more modern engine) since the version 0.93.0 ( 2017-11-20 ) with support for scaling ratios up to 400% via the r_scale configuration option. To use the feature, put a text file named autoexec.cfg into the ID1 subfolder inside the game folder, and put the option like r_scale 4 into this, where 4 is the scaling ratio. For example, at the 3840×2160 chosen in the game settings, the game renders at 960×540 and upscales to 3840×2160 with no blur by representing each logical pixel as a square group of 16 (4×4) physical pixels of the same color.

game (a Quake version powered by a more modern engine) since the version 0.93.0 ( ) with support for scaling ratios up to 400% via the configuration option. To use the feature, put a text file named into the subfolder inside the game folder, and put the option like into this, where is the scaling ratio. For example, at the 3840×2160 chosen in the game settings, the game renders at 960×540 and upscales to 3840×2160 with no blur by representing each logical pixel as a square group of 16 (4×4) physical pixels of the same color. Nonblurry integer-ratio scaling is built into the Dusk game ( 2018 ) (a retro-style 3D shooter) with support for scaling ratios up to 800%. It can be enabled with the “Pixelization” → “ 1x-8x ” setting in the “Advanced Display Settings” section in the game settings. The setting is reportedly set to the “2x” value by default, that, for example, corresponds to the Full HD logical resolution on a display with the 4K native resolution.

Viewing images and playing videos

For viewing images — the XnView application with the unchecked checkbox Tools → Options → View → High quality zoom → Enlarge. Limitation: the option is applied to all viewed images regardless of ratio of their size to size of the application’s window and using full-screen mode.

application with the unchecked checkbox Tools → Options → View → High quality zoom → Enlarge. Limitation: the option is applied to all viewed images regardless of ratio of their size to size of the application’s window and using full-screen mode. For playing videos — the MPC-HC player with the setting View → Options → Playback → Output → Resizer → Nearest neighbor. The setting is available when using rendering engines “Video Mixing Renderer 9 (renderless)”, “Enhanced Video Renderer (custom presenter)” and “Sync Renderer”. A rendering engine can be selected via the “DirectShow Video” dropdown on the same settings’ page. A limitation: the option is applied to all played videos regardless of ratio of their frame size to size of the application’s window and using full-screen mode. Development is now continued by clsid2 on GitHub.

Windows’ built-in features

For windowed applications — Windows Magnifier. Drawbacks: unusable user interface — it’s hard to align precisely the scaling area with the bounds of the object to scale; when the size of the object to scale and the monitor’s resolution are not divisible, the area around the object is not filled with a single-color background, so other objects are visible besides the scaling subject itself; in windowed mode, there are a lag and some jerkiness; in full-screen-output mode, there is jerkiness at least in some games ( e. g. WRC 6 ) (maybe specific to Windows 7) and a lag is possible;

For windowed Windows applications incompatible with HiDPI (non-DPI-aware) — using Windows 10, where, unlike Windows 7, old applications are automatically scaled with no blur at integer Windows zooms.

In Windows 10, for games with support for the “Borderless” pseudo-full-screen mode (a window with no borders that has a size of entire screen), it’s possible to use nonblurry scaling with a ratio equal to system-level zoom. “Borderless” is a special type of windowed mode that, unlike the regular windowed mode, uses a window that has neither borders nor a titlebar, so the entire window is the game-rendering area. Depending on the game or its settings, such a window may either occupy the entire screen or have a fixed size equal to in-game resolution. For scaling with the “Borderless” mode: the game must be running in the DPI-scaling mode — Windows built-in mode for scaling old applications not intended for using with high-pixel-density displays; the “Borderless” mode must be chosen in the game settings. In different games, this mode may be called differently, e. g. “Borderless Full Screen”, “Borderless Windowed”, “Borderless”, “Windowed Fullscreen”, “Fullscreen Windowed”. In some games, the mode called “Full Screen” is actually “Borderless” instead of being true (exclusive) full-screen mode; the system/in-game resolution ratio must be exactly equal to the zoom ratio in Windows. For example, if for a monitor of the resolution of 3840×2160 (4K) in Windows 10, the zoom of 200% is set (the ratio is 2 ), the resolution in game settings must be 1920×1080 (Full HD): 3840 / 1920 = 2

2160 / 1080 = 2 To force DPI scaling in Windows 10 for a game even if the game is declared as HiDPI-compatible (DPI-aware), use properties of the game’s executable file ( *.exe ), see details below.



DPI awareness of applications in Windows

Windows automatically applies DPI scaling to applications and games not declared as HiDPI-compatible (DPI-aware). With DPI scaling applied, user interface of the application is enlarged as a bitmap image with a ratio that matches the OS-level zoom. For example, at the OS-level zoom of 200%, such applications are enlarged twice horizontally and twice vertically.

In order to prevent blur or pixelation due to DPI scaling in games, it’s important to make sure the game is in DPI-aware mode. The criterion is simple: the game-window size in physical pixels should correspond to in-game resolution. For example, window of a game running at Full HD resolution should occupy about 1/4 (1/2 horizontally and 1/2 vertically) of 4K screen at 200% OS-level zoom, not entire screen.

Games that are not DPI-aware require disabling DPI virtualization (DPI scaling) in executable’s properties, to have proper window size with no possibly blurry scaling automatically applied by Windows to non-DPI-aware applications.

DPI scaling for a specific game can be disabled via properties (the “Properties” context-menu item) of the game’s executable ( *.exe ).

Windows 10 “Properties” item → “Compatibility” tab → “Settings” section → “Change high DPI settings” button → “High DPI scaling override” section → “Override high DPI scaling behavior. Scaling performed by” checkbox → “Application” dropdown item. Windows 10 (older builds) “Properties” item → “Compatibility” tab → “Settings” section → “Override high DPI scaling behavior. Scaling performed by” checkbox → “Application” dropdown item. Windows 7 “Properties” item → “Compatibility” tab → “Settings” section → “Disable display scaling on high DPI settings” checkbox.

For some games not declared as DPI-aware, Windows disables DPI scaling automatically. This usually happens when switching for the first time from full-screen mode to windowed mode.

TVs

Some 4K TVs by Panasonic reportedly support displaying Full HD signal with no blur. For example, in the TX-55CX802B model, it is available via the “1080p Pixel by 4 pixels” option in the “Picture → Option Settings” menu. The feature is apparently intended solely for use with Full HD (1920×1080) resolution and does not work at different resolutions of input video signal such as 1280×720. That said, the similar smaller-size model — TX-50CX802 — based on the official manual, does not have the feature. The feature is also available in the models TH-65AX900A, TX-50AX802, and TX-58DX750.

reportedly support displaying Full HD signal with no blur. For example, in the model, it is available via the “1080p Pixel by 4 pixels” option in the “Picture → Option Settings” menu. The feature is apparently intended solely for use with Full HD (1920×1080) resolution and does not work at different resolutions of input video signal such as 1280×720. That said, the similar smaller-size model — — based on the official manual, does not have the feature. The feature is also available in the models TH-65AX900A, TX-50AX802, and TX-58DX750. Nonblurry scaling is reportedly available in the “Graphics” mode in some models of 4K TVs by Sony — e. g. X900E .

Miscellaneous

To disable unreasonable blur of images on web pages — the SmartUpscale extension for Firefox and Chrome browsers.

extension for Firefox and Chrome browsers. There is reportedly no blur when using full-screen scaling with integer ratios via the official Intel ’s graphics driver for Linux operating system.

’s graphics driver for operating system. Since 2018-03-15 , the Raspbian operating system for Raspberry Pi mini computers supports scaling with no blur for the scale of 200% via the “Pixel Doubling” option in the “System” tab in the “Raspberry Pi Configuration” application. Starting with the Raspbian version 2020-02-05 , the “Pixel Doubling” and other display-related options moved to the new “Display” tab.

, the operating system for Raspberry Pi mini computers supports scaling with no blur for the scale of 200% via the “Pixel Doubling” option in the “System” tab in the “Raspberry Pi Configuration” application. Starting with the Raspbian version , the “Pixel Doubling” and other display-related options moved to the new “Display” tab. When playing Nintendo DS games on Nintendo 3DS(XL) consoles, pixel-perfect scaling can be enabled by holding the Start or Select button when launching the game.

Potential solutions

Scaling built into monitor itself. The advantage compared with scaling via graphics driver is saving the graphics interface’s bandwidth and potential decrease of electromagnetic radiation from the signal cable. For example, the 65-inch 4K TV Samsung Q60 (QN65Q60RAFXZA) supports the refresh rate of 120 Hz at Full HD resolution, but just 60 Hz at 4K, so when using GPU for scaling, the refresh rate of 120 Hz is not available.

4K TV Samsung Q60 (QN65Q60RAFXZA) supports the refresh rate of 120 Hz at Full HD resolution, but just 60 Hz at 4K, so when using GPU for scaling, the refresh rate of 120 Hz is not available. A device inserted between signal source and display. The advantage compared with scaling via graphics driver is the ability to use it with any signal source (e. g. a game console or a video player), not only a computer. Potential drawbacks: an extra lag is possible; may have a negative impact to compatibility with the HDCP technology required for playing protected content. Solvable with a switch for temporarily enabling the mode of passing-through the unaltered video signal. The switch could be either physical or controllable from computer via USB. There are similar devices: mCable — HDMI cable with a built-in chip for increasing image quality in real time with applying noise reduction, antialiasing and sharpening with a stated lag of less than 1 ms; DCHDMI intended to output video signal of the Sega Dreamcast game console via HDMI in the Full HD (1080p) format with support for integer scaling with 200% enlargement of the original image (640×480 → 1280×960); UltraHDMI intended to output video signal of the Nintendo 64 game console via HDMI with no quality loss (review). Such device could probably be based on FPGA : 1, 2.



What you can do

Regular users

Complain of blur to technical support of your monitor/TV manufacturer.

Ask about support for nonblurry scaling in comments to reviews of monitors and TVs in mass media.

Tell about the blur issue to as many people as possible and provide links to the petition and to this article.

Game developers

Build integer-ratio scaling into games developed by you. In 3D games, this can be done with the Render-To-Texture technique and GPU-accelerated upscaling of the resulting texture using the “Nearest Neighbour” algorithm. The Unreal Engine has a built-in ability of scaling with no blur via the r.Upscale.Quality console variable with the value of 0 . Integer-ratio scaling is possible with the Godot game engine. See demo project.

Lobby adding integer-ratio scaling into popular game engines such as Unity, CryEngine, so that games based on them would automatically have the feature.

Algorithm

A ready-to-use algorithm of integer-ratio scaling with no blur. An algorithm is a sequence of actions for achieving the needed result.

Brief

Without aspect-ratio correction

Divide the screen width and height by the image width and height correspondingly. Discard fractional part of the less of the results. This is the needed integer ratio.

With aspect-ratio correction

Divide the screen width and height by the image width and height correspondingly. Discard fractional parts. These are maximum integer ratios horizontally and vertically correspondingly. Multiply them by the image width and height correspondingly. The results are the width and height of the area the scaled image will be fit into. If the area aspect-ratio is equal to the target one, the needed integer ratios are equal to the maximum ones. Depending on whether the area aspect-ratio is lower or greater than the target one, make the needed horizontal or vertical integer scale equal to the maximum one on this axis. Calculate approximate scale on the second axis based on the first-axis scale and the target aspect ratio. Round the result up or down depending on what results in minimal aspect-ratio error.

Detailed

Divide the width SW and the height SH of the screen in physical pixels, correspondingly, by the width W and the height H of the image to scale. Discard fractional parts of the resulting ratios, that results in maximum integer ratios MRX horizontally and MRY vertically correspondingly. If aspect-ratio correction is not needed (pixels are square, horizontal and vertical scaling ratios are equal): The integer scaling ratio R is the less of the ratios MRX and MRY . Represent each pixel of the original image as a square group of R × R physical pixels of same color equal to the color of the original-image pixel. Calculate the width UW and the height UH of the scaled image by multiplying, correspondingly, the width W and the height H of the original image by the ratio R . If aspect-ratio correction is needed (pixels are potentially rectangular, horizontal and vertical scaling ratios are potentially different): Multiply the width W and the height H of the image by MRX and MRY correspondingly, that results in the width MW and the height MH of the area which the scaled image will fit into. Divide the width MW of this area by its height MH , that results in the aspect ratio MA of the area. If the ratio MA is equal to the target aspect ratio TA : Assign the scaling ratios RX horizontally and RY vertically the values of MRX and MRY correspondingly. Go to centering the scaled image (the step 4.1). If the ratio MA is lower than the target aspect ratio TA : Assign the horizontal scaling ratio RX the value of MRX . Divide the maximum width MW by the target aspect ratio TA , that results in an approximate scaled height AUH . If the ratio MA is greater than the target aspect ratio TA : Assign the vertical scaling ratio RY the value of MRY . Multiply the maximum height MH by the target aspect ratio TA , that results in an approximate scaled width AUW . Divide the approximate scaled size AUW or AUH by the original image size W or H on the same axis. Round the result in a direction that results in a minimal aspect-ratio error. If errors in both directions are equal or close, round the result in a direction that results in an aspect ratio closest to the original aspect ratio. The resulting integer is the scaling ratio on this axis — RX (horizontal) or RY (vertical). Calculate the width UW and the height UH of the scaled image by multiplying the width W and height H of the original image by the scaling ratios RX horizontally and RY vertically correspondingly. Center the scaled image on the screen: Subtract the width UW and the height UH of the scaled image from the width SW and the height SH of the screen correspondingly, divide the results by 2, discard fractional part, give the resulting numbers the names of X and Y correspondingly. Display the scaled image at a distance of X horizontally and Y vertically from the top-left corner of the screen. Fill the rest screen space around the scaled image with black.

Reference implementation

The author’s library IntegerScaling is a reference software implementation of the algorithm in multiple languages: C++, Rust, JavaScript, PHP. The library is used e. g. in the SNES emulator bsnes-mt.

Example without aspect-ratio correction

It’s needed to display a 640×480 (VGA) image on a 1920×1080 (Full HD) screen:

1920 / 640 = 3

1080 / 480 = 2.25

2.25 is less than 3 . Discarding the fractional part 0.25 results in 2 . So each pixel of the original image should be displayed as a group of 2×2 physical pixels.

The width and the height of the scaled image in physical pixels are 1280 ( 640 * 2 ) and 960 ( 480 * 2 ) correspondingly. So for the purpose of centering on the screen, the scaled image should be displayed at a distance of 320 ( (1920 - 1280) / 2 ) pixels horizontally and 60 ( (1080 - 960) / 2 ) pixels vertically from the top-left corner of the screen.

Example with aspect-ratio correction

It’s needed to display a 400×254 image with a target aspect-ratio of 4:3 on a 3840×2160 (4K) screen:

3840 / 400 = 9.6

2160 / 254 ≈ 8.5

Discard fractional part of the ratios, that results in maximum integer ratios 9 horizontally and 8 vertically correspondingly.

Multiply the width 400 and the height 254 of the image by 9 and 8 correspondingly, that results in the width 3600 and the height 2032 of the area the scaled image will fit into.

The aspect ratio 1.77 of the area is greater than the target aspect ratio 4:3 ( ≈ 1.333 ). So:

set vertical scaling ratio to 8 ;

; divide the maximum height 2032 by the target aspect ratio 4:3 ( ≈ 1.333 ), that results in an approximate scaled width of 2709.333 .

Divide 2709.333 by the original width 400 of the image, that results in 6.773 , round the result, that results in a horizontal scaling ratio of 7 . So the pixel size is 7×8 .

Width and height of the scaled image are 2800 ( 400 * 7 ) and 2032 ( 254 * 8 ) correspondingly. The actual aspect ratio is about 1.378 ( 2800 / 2032 ), an error compared with the target aspect ratio 4:3 ( ≈ 1.333 ) is about 3.35% .

For the purpose of centering on the screen, the scaled image should be displayed at a distance of 520 ( (3840 - 2800) / 2 ) pixels horizontally and 64 ( (2160 - 2032) / 2 ) pixels vertically from the top-left corner of the screen.

Reference rendering

The images below show how the results of nonblurry integer-ratio scaling without aspect-ratio correction must look. With a proper implementation of integer-ratio scaling, the results of scaling the provided original images must be identical to the provided reference renderings of scaled images.

To prevent affecting image appearance by the web browser, it’s recommended to save the images to your computer and view them with a standalone application at the zoom of 100%. You can also download all the images at once as an archive (80 KB).

Images Ratio Black background Note Original Upscaled Full Integer Left +

right Top +

bottom 320×240

qVGA, 4:3 3840×2160

4K UHD, 16:9 9

900% 480+480 0 Image at full height, black only at the left/right 640×480

VGA, 4:3 1920×1080

Full HD, 16:9 2.25

225% 2

200% 320+320 60+60 1280×720

HD, 16:9 1920×1080

Full HD, 16:9 1.5

150% 1

100% 320+320 180+180 Identical to the “Center” mode 1280×720

HD, 16:9 2560×1600

WQXGA, 16:10 2

200% 0 80+80 Image at full width, black only at the top/bottom 1920×1080

Full HD, 16:9 3840×2160

4K UHD, 16:9 2

200% 0 0 Resolutions are divisible, so no black background

User interface

Introduction

The simplest user interface for controlling nonblurry upscaling could be represented by a single checkbox “Prevent blur when upscaling” intended for enabling integer-ratio scaling with no blur.

A more flexible variant is to control blur and ratio integerness separately. That needs two settings:

for disabling blur regardless of whether scaling ratio is integer or fractional — this just results in using the “Nearest neighbour” algorithm instead of bilinear interpolation; for using solely integer scaling ratios for preventing image distortion in the nonblurry-scaling mode.

Integerness makes sense mainly in combination with nonblurriness, so the second setting could only get available when the first one is enabled. But for more flexibility or for simplifying UI implementation, the two settings could be indepedent.

Each of the two settings can be represented by either a checkbox or a list of two mutually exclusive options with one selected by default.

Checkbox + pixel-size variability options

Probably the most user-friendly and intuitive user interface would consist of a checkbox like “Prevent blur when upscaling”.

Checking the checkbox would enable the “Nearest neighbour” upscaling algorithm and also make available an extra setting “Pixel size” with the two options available:

constant (no image distortion, but black bars are possible around the image); variable (maximum usage of the screen space at the cost of some image distortion).

The text in parens could be displayed using a smaller font size, or dynamically displayed as a hint appearing when the user hovers the option with mouse cursor.

Separate filtering and integer-scale options

The user interface could be similar to the one used in RetroArch that provides two boolean (on/off) options in its video settings:

“Bilinear Filtering”;

“Integer Scale”.

The first one enables/disables blur, the second one enables/disables using solely integer ratios for pixel-perfect upscaling with no distortion of the image.

Such interface allows to combine blur and an integer ratio, but this doesn’t make sense in practice.

The terms “bilinear filtering” and “integer scale” might not be clear enough for non-advanced users.

Two new options in the flat list of upscaling modes

Two new options could be added to the existing list of the classic upscaling modes (“Center”, “Stretch”, “Maintain Aspect Ratio”):

“Prevent blur (maximum screen-space use, distortion is possible)”.

“Prevent blur and distortion (black borders are possible)”;

This UI variant is a trade-off between user-friendliness and technical simplicity of UI implementation.

Frequently asked questions (FAQ)

Is this just for pixel art, emulators and old games? No, that’s a myth. A crucially important use case of integer scaling is preventing unreasonable sharpness loss in modern 3D games at the Full HD resolution used instead of native display resolution on 4K monitors for the purpose of boosting performance. Is this the same as “Nearest Neighbour”? Only partially. The results of using the “Nearest Neighbour” algorithm and integer-ratio scaling are only identical at integer scaling ratios — e. g. 2 or 3 . At fractional scaling ratios ( e. g. 4.5 when scaling 640×480 to 4K), “Nearest Neighbour” leads to image distortion and so called pixel shimmering. This is due to different sizes of pixels in the same image: for example, at 150% scale, some pixels are 1×1, while others are 2×2, 2×1, and 1×2.

when scaling 640×480 to 4K), “Nearest Neighbour” leads to image distortion and so called pixel shimmering. This is due to different sizes of pixels in the same image: for example, at 150% scale, some pixels are 1×1, while others are 2×2, 2×1, and 1×2. With integer-ratio scaling, the scaling ratio is always integer ( e. g. exactly 4 in the 640×480→4K case) — regardless of the native-to-logical resolution ratio. The space that might be left empty due to nondivisibility of the resolutions is filled with black like in the “Center” mode. Is this about disabling antialiasing? No. Blur has nothing to do with antialiasing. Antialiasing is applied during rendering a 3D scene, while blur is added during upscaling an already rendered image as an array of pixels. Integer scaling can (and should) be used together with antialiasing. You enable antialiasing in the game, you disable upscaling blur in graphics driver, and you get a Full HD image on a 4K monitor with the same quality as on a monitor with the native Full HD resolution. Wouldn’t pixels be noticeable without blur? This is not always so, and is not necessarily bad when so. Noticeability of pixels depends on the combination of the display resolution, the original-image resolution, the distance to the screen and the quality of anti­aliasing in the game. For example, at the Full HD resolution on a 24″ 4K monitor at a typical distance of 50-60 cm from the screen with quality antialiasing in the game, logical pixels are almost indistinguishable, so blur just unreasonably decreases sharpness. This author plays FHD games with IntegerScaler and watches FHD videos with MPC-HC on the 24″ 4K monitor Dell P2415Q on a regular basis. Now imagine scaling 4K to 8K or 8K to 16K under the same conditions. The pixel density corresponding to 8K at 27″ is already real in 13.3″ 4K laptops.

from the screen with quality antialiasing in the game, logical pixels are almost indistinguishable, so blur just unreasonably decreases sharpness. This author plays FHD games with IntegerScaler and watches FHD videos with MPC-HC on the 24″ 4K monitor Dell P2415Q on a regular basis. Now imagine scaling 4K to 8K or 8K to 16K under the same conditions. The pixel density corresponding to 8K at 27″ is already real in 13.3″ 4K laptops. Whether noticeable pixelation is appropriate depends on the type the original image: e. g. for pixel art, pixelation is an intended effect, so blur distorts the author’s intent. But I like blur! No problem. Integer-ratio scaling is meant to be an enableable/disableable (optional) feature. If you like blur, you could just not enable integer-ratio scaling in the settings of graphics driver or display. Why use 4K monitor if play at Full HD anyway? Computers are used not just for games: comfort during working with text in any way (web surfing, text editors, programming, web development), drawings, charts is enormously higher on a 4K monitor than on a FHD monitor, thanks to the increased detail, invisible interpixel grid and greatly decreased “fussing around” sequential flickering of subpixels; a higher native resolution allows to view photos at higher quality; a higher native resolution allows to increase color depth (bit depth) with no flickering — by displaying average colors via adjacent pixels displaying slightly different colors.

Even if the computer is fast enough for running games at the 4K resolution, not all games work correctly at this resolution: e. g. controls in “Cities XL Platinum” get too small; and in “Bionic Commando Rearmed”, conundrum elements are invisible in “Hack enemy network” sublevels.

controls in “Cities XL Platinum” get too small; and in “Bionic Commando Rearmed”, conundrum elements are invisible in “Hack enemy network” sublevels. The higher the native resolution is, the fuller the screen may be used with integer-ratio upscaling. For example, when scaling 320×240 to Full HD, 1/9 (11%) of the screen height is lost (filled with black) ( 1080/240 = 4,5 ), while on a 4K display, the ratio is exactly 9 , so the image occupies the entire height of the screen. On 8K displays, the same will apply to the 640×480 resolution; it will also be possible to use any of the typical resolutions with no loss of quality or screen space: HD (1280×720, 6x), FHD (1920×1080, 4x), QHD (2560×1440, 3x), 4K (3840×2160, 2x). Can it make 1440p look better on 4K monitor? No. Integer-ratio scaling is not a magic wand that improves quality of any image. It’s based on a simple mathematical principle that makes it possible when enlarging an image by an integer number of times, just to duplicate the original pixel with no need for mixing-in colors of adjacent pixels, thus preventing blur. To use integer scaling at QHD (2560×1440), you need a 5K (5120×2880) or 8K (7680×4320) display: 5120 / 2560 = 2880 / 1440 = 2.0

7680 / 2560 = 4320 / 1440 = 3.0 With a 4K (3840×2160) display, the maximum logical resolution for integer scaling to work is Full HD (1920×1080): 3840 / 1920 = 2160 / 1080 = 2.0 At QHD, the native/logical ratio is 1.5: 3840 / 2560 = 2160 / 1440 = 1.5 1.5×1.5 pixel groups are physically impossible. The maximum integer ratio is 1.0 which is equivalent to the regular centered mode at 100% scale with thick black bars around the image. The same applies to scaling HD (1280×720) to Full HD (1920×1080). For integer scaling of 1280×720, the display resolution must be at least 2560×1440 (200% scale, 2×2 pixels). Isn’t this built into OpenGL and DirectX? In the 3D rendering APIs like OpenGL (the GL_NEAREST mode) and DirectX, the “Nearest Neighbour” algorithm is indeed available, but intended for scaling textures. While developers of a specific game could indirectly utilize this feature for integer-ratio scaling in this specific game, scaling textures is not directly related to universal full-screen scaling transparent to operating system and software. Should this be handled by display or graphics card? Support for scaling by graphics driver does not contradict with the same support by the display, and vice versa. Even if new displays start supporting nonblurry scaling, this won’t help owners of existing displays, while graphics-driver scaling will.

Scaling via graphics card is not available if the signal source is not a computer, but e. g. a game console or a video player. Also, integer scaling, though supported by modern graphics drivers, in case of nVidia GPUs, is only available for modern graphics cards starting with the Turing generation (2019) (RTX and GTX 16*) and only under Windows 10. In such cases, monitor’s or TV’s own scaling is inevitably used.

a game console or a video player. Also, integer scaling, though supported by modern graphics drivers, in case of nVidia GPUs, is only available for modern graphics cards starting with the Turing generation (2019) (RTX and GTX 16*) and only under Windows 10. In such cases, monitor’s or TV’s own scaling is inevitably used. When scaling with GPU, the display always receives the signal at the display’s native resolution, so all the limitations compared with display scaling apply, including potentially lower refresh rate or lower color depth.

Speci­fically the implemen­tation of integer scaling in nVidia graphics driver has multiple serious limitations including incompati­bility with HDR , custom resolutions and 4:2:0 chroma subsampling.

, custom resolutions and 4:2:0 chroma subsampling. GPU scaling reportedly increases input lag.

Transmitting more data from graphics card to display takes more time and may increase input lag. So display’s own scaling is preferred. Shouldn’t this be handled by operating system? Windows doesn’t have access to screen contents in exclusive full-screen mode. To make it possible to implement full-screen scaling on Windows’ level, the Windows’ display-driver model (WDDM) would need to be fundamentally changed, and even in that case an extra lag would be possible compared with scaling via graphics-driver’s own means. Isn’t DLSS a better method? The DLSS method is not a universal solution: available only on modern nVidia GPUs;

requires individual support by each specific game;

may introduce various unpredictable image artifacts;

intended for 3D games and not applicable to games of other types — e. g. based on pixel art. How is this different from sharpening? Integer-ratio upscaling with no blur has nothing to do with sharpening. Integer-ratio upscaling prevents quality loss caused by blur, while sharpening tries to improve legibility of an already blurry image. How is this different from DSR/VSR? DSR / VSR and integer-ratio scaling resize image in different directions, in different ways and for different purposes. When using DSR/VSR, the image is rendered at a resolution higher than the native display resolution and then downscaled to the display resolution. In fact this is just SuperSampling antialiasing (SSAA) that can be used in games not having built-in support for such antialiasing.

When using integer-ratio scaling, the image is rendered at a resolution lower than the native display resolution and then upscaled (stretched) with no blur to the resolution less than or equal to the display resolution while using a highest possible integer scaling ratio. The only thing that DSR/VSR and integer-ratio scaling share is the universal resolution virtualization transparent to operating system and software and compatible with all full-screen applications. How is this different from resolution scaling? The “Resolution Scaling” feature available in some games is intended for scaling by the game itself. Unlike using a resolution from a predefined set of resolutions, the feature allows to precisely find an optimal combination of detail and performance: e. g. if at the 2560×1440 resolution, performance is not enough, while at 1920×1080 it’s too high, it’s possible to choose 2560×1440 in the game and use resolution scaling for decreasing the resolution e. g. to 2400×1350. In the majority of games this feature results in blur even if the resolution-scaling ratio is integer. Integer-ratio scaling with no blur is free of quality loss caused by blur, and a proper implementation should be compatible with all full-screen applications. How is this different from checkerboard rendering? Like using a lower resolution, checkerboard rendering allows to increase performance. But checkerboard rendering has nothing to do with scaling: a 3D scene is rendered in a half resolution by rendering pixels checkerwise, then colors of missing pixels are calculated by averaging colors of adjacent rendered pixels and/or based on pixels from the previous frame. Such approach is similar to interlacing typically used in TV broadcasting for video coding, and allows in games to achieve quality close to rendering at full resolution ( e. g. 4K ), but with almost double performance. With integer-ratio scaling with no blur, all image pixels are rendered, then the image is upscaled without altering it in any way and calculating any average colors.

Progress

AMD — supported for GCN 2+ under Windows 7/10

In AMD graphics driver, integer-ratio scaling with no blur is available since Radeon Software 2020 (19.12.2) ( 2019-12-10 ) for Windows 7/10. Starting with the version 20.1.4 ( 2020-01-27 ), an issue was fixed, that previously resulted in the feature being not available on some Windows 7 systems.

The feature is available for GPUs of multiple previous generations starting with the 2nd-generation GCN architecture ( 2013 ) including GPUs of the R7 260, R9 285 and R9 290 series. This is an advantage over Intel’s and nVidia’s implementations.

Integer scaling can be enabled by switching the “Integer Scaling” option to the “Enabled” value on the “Display” page opened via the same-name item of the menu opened by pressing the gear (⚙️) button in the top-right part of the Radeon Software window. It’s also possible to override the scaling mode for a specific game in its properties on the “Gaming” page.

Compatible with sharpening and VSR

The AMD implementation of integer scaling reportedly allows to combine integer scaling with Radeon Image Sharpening (RIS) and VSR, that, along with support for previous-generation GPUs, is an advantage over the nVidia’s implementation.

Combining VSR with integer scaling potentially allows e.g. entirely use Full HD screen height at logical resolution of 320×240 (pure ratio is 4.5) at the cost of some blur of pixel edges as a result of turning the native Full HD resolution into the virtual 4K (the ratio is exactly 9).

Limitations

Release notes for Radeon Software 2020 19.12.2 say that sometimes integer scaling may result in flickering.

Some users report that when recording gameplay video (with e. g. OBS ) with integer scaling enabled, recorded is the area at the top-left corner of the scaled image, the size of the area is equal to the original (before scaling) resolution, and the rest space in the video is black.

) with integer scaling enabled, recorded is the area at the top-left corner of the scaled image, the size of the area is equal to the original (before scaling) resolution, and the rest space in the video is black. A user of Radeon RX 5700 XT ( 2019 ) reported that with Radeon Software 19.12.3, integer scaling works in games, but not in Windows itself. At the same time, for a user of Radeon RX Vega 64 ( 2017 ) with Radeon Software 19.2.2 and TCL S425 4K TV, the issue does not reproduce.

) reported that with Radeon Software 19.12.3, integer scaling works in games, but not in Windows itself. At the same time, for a user of Radeon RX Vega 64 ( ) with Radeon Software 19.2.2 and TCL S425 4K TV, the issue does not reproduce. A user of Radeon RX 480 ( 2016 ) reported that there are a lag and performance drop when using integer scaling in conjunction with vertical synchronization (VSync) and resolutions that result in letterboxing (black bars above and below the scaled image). The issue also reproduces in the “Center” mode, and even with the previous version of the driver that didn’t support integer scaling.

) reported that there are a lag and performance drop when using integer scaling in conjunction with vertical synchronization (VSync) and resolutions that result in letterboxing (black bars above and below the scaled image). The issue also reproduces in the “Center” mode, and even with the previous version of the driver that didn’t support integer scaling. A user reported that when logical and native resolutions are not divisible, the scaled image is only centered horizontally, but touches the top edge of the screen instead of being centered vertically too.

Polls

Before the feature was implemented, there were two polls conducted during 2019. In both polls, the item “GPU Integer Scaling Support” was leading (about 50% of votes), and the number of votes keeps growing.

AMD — being implemented for Linux

Support for nonblurry integer-ratio scaling is being implemented in the AMD-specific part of the Linux kernel.

Based on the program code and the description of the patch from October 17, 2019 , integer-ratio scaling is going to be transparently used in the existing Centered mode and is not going to be available as a separate scaling mode. Implementing started on June 10, 2019 .

Intel — supported for Ice Lake (Gen10) CPUs under Windows 10

The announcement and the article

Support for nonblurry full-screen integer-ratio scaling is available in the Intel graphics driver for Windows since the beta version 25.20.100.7155 ( 2019-08-30 ). The stable version 26.20.100.7212 was released a month later . Support for the feature was originally announced by Intel on June 24, 2019 . On July 12 , an article with details has been published on the Intel site.

The feature is available via the “Retro Scaling” option in the “Intel Graphics Command Center” application. The option has three possible values:

Off

Scaled width

Fixed width

“Scaled width” means just using the “Nearest neighbour” resizing algorithm, while “Fixed width” is Nearest neighbour combined with using solely integer ratios to prevent image distortion — i. e. integer scaling.

System requirements

A requirement is an 11th-generation (Gen11) GPU that will be used in the upcoming 10th-generation (Gen10) Intel CPUs (Ice Lake). The first Ice Lake CPUs are expected to release in late 2019 , the first devices will be laptops.

The Intel graphics driver and the “Intel Graphics Command Center” application require the operating system Windows 10 of version 1709 or higher.

Hardware support and performance

Intel graphics since the Gen11 have hardware support for the “Nearest Neighbour” scaling algorithm. Thanks to this, enabling nonblurry upscaling won’t affect performance.

In Intel GPUs of previous generations (10th and older), hardware support for “Nearest Neighbour” suitable for full-screen scaling was missing. So the feature implementation for them could only be pure-software that would be nontrivial and would result in too low performance.

Support for integer and fractional zooms

Both variants of nonblurry upscaling are available:

integer-ratio upscaling with a constant pixel size and no distortion of the image, but with possible black bars around the image;

the “Nearest Neighbour” algorithm with maximum usage of the screen area at the cost of some image distortion due to variable size of adjacent pixels.

They can be enabled via the “Fixed width” and “Scaled width” values of the “Retro Scaling” option correspondingly.

Limitations

The minimal resolution that will be supported by the first implementation is 640×480. Support for lower or user-defined resolutions may appear in future versions of the Intel graphics software.

A user of a laptop with integrated Intel GPU reported via Discord about banding in HDR mode.

nVidia — supported for Turing GPUs under Windows 10

Support for integer scaling is available in nVidia driver for Windows since the version 436.02 (2019-08-20), but only when using graphics cards of the Turing generation (RTX and GTX 16*) and only in Windows 10 version 1803+. (Redstone 4) released on April 2018. The feature is not available under Windows 7, though the driver itself is available. The current implementation is considered experimental and has beta status.

The feature is also available in the graphics driver for professional nVidia Quadro GPUs since the version R440 U1 (440.97) ( 2019-10-22 ).

The feature can be enabled via the option “Integer scaling” in the dropdown “Display” → “Adjust desktop size and position” → “Scaling” → “Select a scaling mode” in the nVidia control panel. For scaling with GPU, the “GPU” item must be selected in the dropdown “Perform scaling on”.

Limitations

The feature is not available:

in the “Surround” mode;

with multiple displays in the “tiled” mode;

in conjunction with custom resolutions;

when using chroma subsampling 4:2:0 (YUV420) (supported color formats: RGB, YUV444, YUV422);

with DSR enabled;

enabled; with nVidia Image Sharpening (441.08+, 2019-10-29 ) enabled;

) enabled; in MSHybrid and nVidia Optimus (integrated GPU + discrete GPU) laptops where the integrated GPU is managing display properties. One of such laptops is reportedly MSI GS65 Stealth 9SG where the Intel UHD Graphics 630 GPU integrated into the Intel i7-9750H CPU is combined with the mobile discrete nVidia GeForce RTX 2080 GPU. Another example is Lenovo Yoga C940-15 . The limitation reportedly does not apply when using an external display instead of the laptop’s own display, for absolute majority of such laptops.

Also, according to release notes, using the current implementation of the feature in conjunction with the HDR mode may lead to system crash ( BSOD ) system hang when changing the resolution while using integer scaling.

Also, according to an official comment at the nVidia forum, their integer-scaling implementation only uses nearest-neighbour scaling when the scaled resolution is a perfect multiple of the source. This implies that their implementation does not force integer scaling ratio if the native/logical resolution ratio is not integer. So e. g. 640×480 is probably blurry on a 1920×1080 display, and there is no black bars above and below the scaled image, even with integer scaling formally enabled.

According to nVidia, incompatibility with HDR and custom resolutions is an unsurpassable fundamental limitation of the programmable filter used to implement integer scaling, and this can’t be fixed at least for Turing-generation nVidia GPUs. nVidia says that integer scaling can’t be used whenever the so called Scan Out Compositor is used, that is the case with e. g. DSR and custom resolutions.

Not available for older GPUs

The feature is not available in the Windows version of the nVidia GeForce driver for previous generations of nVidia GPUs. On March 25, 2019, an nVidia official stated that they have no plans to implement scaling with no blur in their graphics driver for Windows, while admitting that the algorithm itself is straightforward.

As a reason, they refer to impossibility to implement this feature in the Windows driver in a way that wouldn’t require “ongoing continuous support” given that WDDM specs of graphics drivers in Windows 10 are consistently changed.

That said, nVidia officials ignore questions about whether the same ongoing continuous support is required for the existing DSR technology that, as well, does resolution virtualization transparent to operating system and full-screen applications.

nVidia — limited support in Linux driver

The nVidia GeForce graphics driver for Linux, Solaris, and FreeBSD operating systems since the version 384.47 ( 2017-06-29 ) provides the “Nearest Neighbour” scaling algorithm as a part of the “Transform Filter” feature. It can be enabled with a command like this:

nvidia-settings -a CurrentMetaMode="DP-1: 3840x2160_60 {ViewPortIn=1920x1080, ViewPortOut=3840x2160, ResamplingMethod=Nearest }"

where:

DP-1 is the video output the monitor is connected to;

is the video output the monitor is connected to; 3840x2160 is the resolution of the signal received by monitor; must be equal to physical monitor resolution, otherwise there will be blur due to scaling done by the monitor;

is the resolution of the signal received by monitor; be equal to physical monitor resolution, otherwise there will be blur due to scaling done by the monitor; ViewPortIn is the size of the rendering area in logical pixels;

is the size of the rendering area in logical pixels; ViewPortOut is the size of the resulting scaled image in physical pixels;

is the size of the resulting scaled image in physical pixels; ResamplingMethod is a scaling algorithm (the default value is Bilinear ).

The result of scaling may be smaller than physical monitor resolution. For example, to display a 1280×720 image with 2-times enlargement (with 2×2 pixels) centered on screen of monitor with physical resolution of 3840×2160, the following command is needed:

nvidia-settings -a CurrentMetaMode="DP-1: 3840x2160_60 {ViewPortIn=1280x720, ViewPortOut=2560x1440+640+360, ResamplingMethod=Nearest }"

where 640 and 360 are offsets in physical pixels from top left corner horizontally and vertically correspondingly, needed for centering the scaled image.

Commands can be executed via terminal that can be opened with the Ctrl + Alt + T keyboard shortcut.

Software implementation and performance

The only interpolation available on hardware level in nVidia GPUs is blurry bilinear interpolation, so the “Nearest Neighbour” scaling algorithm is implemented in software and uses some GPU power. This can potentially slightly decrease maximum GPU performance. In practice, performance is about the same regardless of interpolation type: “Nearest Neighbour” ( Nearest ) or bilinear ( Bilinear ).

Unfortunately in some games, using the transform filter itself leads to a serious performance drop. For example, in the “F1 2017” game at the resolution of 1280×720 when using transform filter, performance is lower that at the resolution of 1920×1080 in regular full-screen mode. When scaling the game running in windowed mode, performance is much higher than with full-screen scaling via transform filter, but still lower than in regular full-screen mode.

Windowed and pseudo-full-screen games only

Unfortunately the feature work only with windowed and pseudo-full-screen (rendered over OS desktop) games. The scaling is not applied to really full-screen games that switch monitor resolution (e. g. “Euro Truck Simulator 2”).

That said, in many games, the feature works incorrectly: the image is rendered at the resolution selected in the game’s settings (e. g. 1920×1080), then upscaled with blur to the ViewPortOut resolution (e. g. 3840×2160), then cropped to top-left or bottom-left part corresponding to the ViewPortIn (e. g. 1920×1080) size, and only this cropped part is then output to monitor.

The issue is not specific to a particular desktop environment and takes place at least in Unity (Ubuntu 17.04) and GNOME (Ubuntu 17.10).

When running a game in windowed mode, the visible part of the game window can be maximized by enabling automatic hiding of the Dock panel via Ubuntu settings (Settings → Dock → Auto-hide the Dock), and using the GNOME extension Hide Top Bar to autohide the top bar. To minimize the height of the title bar of the game window, it makes sense to switch OS-level zoom to 100%.

Mouse and resolution

A companion issue is that even if a rendered game output is visible entirely, its menus, buttons and other controls may be not accessible for mouse hovering and clicks if the desired logical resolution ( ViewPortIn ) was not chosen in the game’s settings before enabling the Nearest mode in the graphics driver.

This is because by default, the game may run at the output driver resolution ( ViewPortOut ) instead of the logical one ( ViewPortIn ). This may also lead to serious loss of performance: the game will be first rendered at the high resolution, then downscaled to the low one, then upscaled back to the high one using the “Nearest Neighbour” interpolation.

Official nVidia comments

One of the Linux-driver developers Aaron Plattner believes the issue is not with the driver, but with games incorrectly interpreting data received from the RandR software subsystem.

He admits that given the number of affected games, a universal game-independent solution for the issue would make sense. As a possible implementation of such solution, he mentions an LD_PRELOAD library that could intercept calls to libXrandr functions and fake the replies. That said, he doesn’t say whether such solution is going to be developed by nVidia itself and distributed together with the graphics driver.

Tested games

The table contains the results of testing some games at Full HD (1920×1080) virtual resolution on the Dell P2415Q monitor with 4K (3840×2160) physical resolution under Ubuntu 17.10 and 18.04.

Linux — limited support in XRandR

The system Linux application XRandR for controlling the graphics subsystem allows to enable nonblurry scaling regardless of GPU vendor. The feature is available since the version 1.5.1 ( 2019-08-12 ) and can be enabled with a command like this:

xrandr --output DP-1 --scale 0.5x0.5 --filter nearest

where:

DP-1 is the video output the monitor is connected to;

is the video output the monitor is connected to; 0.5 is the reduction factor: e. g. 0.5 on a 4K (3840×2160) monitor results in a virtual resolution of Full HD (1920×1080);

The video output can be seen in graphics-card control panel or in the list provided by this command:

xrandr | grep " connected " | awk '{ print$1 }'

For example, in a virtual machine of VMware Player 15.5.6, this command outputs the Virtual1 string.

Many Linux distros including Ubuntu 20.04.1 still come by default with the outdated XRandR version 1.5.0. This version supports scaling, but does not support the --filter parameter, so disabling blur is unavailable in this version. When trying to use the --filter parameter, the following error message is displayed:

xrandr: unrecognized option '--filter'

Installing development version of XRandR

Warning: installing development versions of fundamental system applications in Linux may affect functioning of the whole system, some of its functions or third-party software.

Development version of XRandR can be installed with the following command sequence:

git clone git://anongit.freedesktop.org/xorg/app/xrandr xr

cd xr

./autogen.sh

sudo make install

Before that, it may be required to install extra packages or development versions of some of already installed packages. For example, in a just installed Ubuntu 18.10, it’s enough to install the git , xorg-dev , xutils-dev , autoconf packages with the following commands:

sudo apt install git

sudo apt install xorg-dev

sudo apt install xutils-dev

sudo apt install autoconf

Only windowed and pseudo-full-screen games

Compatibility with games and limitations are similar to those of transform filters in nVidia Linux driver: scaling is only possible for games running in windowed or pseudo-full-screen (borderless) mode.

Some games in pseudo-full-screen mode are displayed cropped: for example, at in-game resolution of Full HD on a 4K monitor, only the bottom-left or top-left quarter of the image is typically visible. In true (exclusive) full-screen mode, an even smaller part of the image is visible, because not just a part of the original image is upscaled to native monitor resolution, but also the monitor switches to a lower resolution.

Linux — support in Proton

Proton since the version 4.11-10 ( 2019-12-13 ) supports integer-ratio scaling with no blur. It can be enabled with the environment variable:

WINE_FULLSCREEN_INTEGER_SCALING=1

Proton is an improved version of WINE. Proton is used in the “Steam Play” feature that allows to run Windows games under Linux right via the Steam client with no need to manually install and set-up WINE.

Compared with nVidia transform filters and scaling with XRandR, integer scaling built into Proton is potentially more convenient:

applied only to running game, but not to user interface of the operating system;

automatically handles cases when the game switches between different resolutions.

Monitors — announced for Eve Spectrum QHD and 4K monitors

Support for pixel-perfect integer-ratio upscaling is planned for the computer monitors Eve Spectrum being developed with taking community feedback into account.

This scaling method is planned to be enabled by default which is stated in the “Feature requests” section on the feature-update page from 2019-10-10 .

There will be three 27″ monitor models based on IPS LCD panels produced by LG Display: two with the 2560×1440 (QHD) resolution, and another one with the 3840×2160 (4K) resolution. The 4K model and the lower-level QHD model will support refresh rates up to 144 Hz, the higher-level QHD model — up to 240 Hz. The variable-refresh-rate ( VRR ) technology “FreeSync Premium Pro” (“G-Sync Compatible”) is supported with a minimal refresh rate of 48 Hz. High dynamic range (HDR) is supported: HDR600 for the two higher-level models and HDR400 for the lower-level one. The LCD panel of the lower-level QHD model is LG 27GL850 of the “Nano IPS” type with a response time of 1 ms.

The approximate release dates of the monitors: Q3 2020 for the lower-level QHD model, and Q4 2020 for the 4K model and the higher-level QHD model. Preorder is available at the prices of 380 (QHD@144), 520 (QHD@240) and 620 $ (4K@144); the optional stand costs another 100 $.

The 4K monitor by another manufacturer, based on the same LCD panel — LG 27GN950 — reportedly does not support integer scaling.