Pixel-perfect integer-ratio scaling with no blur
a.k.a. integer scaling

Pixel-perfect scaling, or integer scaling, is a method for image upscaling (enlargement) with no blur and no distortion.

Turns each pixel into a square or rectangular group of integer number of same-color pixels. Prevents sharpness loss in videos and 3D games when scaling Full HD to 4K and maintains pixelation in old and pixel-art games.

Summary

Issue

Full HD on 4K monitors and most 4K TVs looks worse than on Full-HD monitors and TVs.

This happens due to blur added by all monitors and absolute majority of TVs at any scale, 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 videos and 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.

If the native display resolution and logical resolution are not divisible, we can use the maximum integer scale that the scaled image fits the screen at, and fill the rest space with black, like in centered mode without scaling.

Such lossless scaling is already built into graphics drivers and some software video players and removes blur regardless of monitor or TV used. But such prescaling is impossible if the signal source is not a computer, but e. g. a game console or a hardware video player.

Also, prescaling 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 () 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+ () 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+ () for Windows 10; incompatible with HDR, tiled mode, custom resolutions, 4:2:0, sharpening, DSR, and hybrid-GPU laptops.
  • Linux: supported in Proton 4.11-10+ () (used in Steam Play); limited support in XRandR 1.5.1+ () and nVidia graphics driver 384.47+ (): image is cropped in many games.
  • Monitors: supported in 27″ 4K and QHD monitors Eve/Dough Spectrum based on LG Nano IPS panels with refresh rates up to 144 Hz (QHD, 4K) and 240 Hz (QHD); 4K model is already being shipped to customers, QHD@240 and QHD@144 are expected in  and  correspondingly.
  • Standalone scalers: RetroTink-4K ($1000) and Morph 4K ($400-500) are expected to release in late 2023, with support for 4K output, integer scaling of digital and analog signals, and simulation of CRT displays.

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 scale. Such sharpness loss is perceived as blur and is irreversible quality loss.

But actually, the blur is only inevitable when enlarging by a non-integer number of times. 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 scale 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 scaling (integer-ratio, integer-factor, integral scaling);
  • pixel-perfect scaling;
  • pixel doubling (duplication).

More than Nearest Neighbour

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

As a result of such distortion, same pixels of virtual objects moving on the screen, are constantly changing in size. This results in so called pixel shimmering, or jitter.

Integer-ratio scaling is lossless because the scale is always integer and all pixels have the same size. If resolutions of the display and the image are not divisible, the image is scaled with such an integer ratio that results in filling the screen as fully as possible, and the rest screen space is filled 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 (4K) 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 on the left and on the right.

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 displays with high pixel density (HiDPI):

    • games that don’t scale their user interface;
    • games that work incorrectly at 4K+ resolutions;
  • with nonblurry scaling:

    • ability to use higher-resolution displays with lower-resolution video sources such as game consoles, with no unreasonable quality loss caused by blur;
    • 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 pointlessly decreases sharpness resulting in an unreasonable quality loss.
  • Integer-ratio scaling by pixel duplication needs no calculations and so works much faster than bilinear or bicubic interpolation. This makes it possible to:

    • decrease or remove a extra input lag introduced by scaling;
    • save computational power of the scaling device;
    • decrease its power consumption, heat and cooler noise.
  • 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. Noise has a negative impact to user comfort and may result in irreversible diminished hearing in 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.
  • Faster CPU and/or GPU do not solve the issue entirely since the issue is not just about computer performance (see below).
  • Integer-ratio scaling is required for uniform distribution of scanlines often used for increasing perceived detail in old games.
  • When using even integer scales in conjunction with 4:2:2 or 4:2:0 chroma subsampling, integer-ratio scaling on signal-source side allows to decrease needed video-interface bandwidth by two or four times correspondingly with no quality loss. For example, 4K at 4:2:0 needs the same bandwidth as Full HD at 4:4:4.

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 scale, so blur as a sort of smoothing gets even less reasonable. For example, a pixel on a 24–27″ 4K monitor can still be noticeable at the Full HD (1920×1080) resolution at a certain combination of 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 the same 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 (the scale 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
  • With a higher-resolution display, it’s possible to achieve a more precise aspect ratio of the image when doing integer scaling on both axes with aspect-ratio correction enabled. For example, for the resolution of 256×224 typical for 16-bit game consoles such as SNES and Sega Genesis (Mega Drive), on a 4K display, aspect-ratio error relative to the perfect aspect ratio of 4:3 is 5%, while on a 8K display, the error is below 1%.
  • On 8K displays, integer-ratio scaling allows to use with no loss of quality or screen space, any of the typical resolutions, effectively allowing to flexibly change the native display resolution:

    • 8K (7680×4320, 1x);
    • 4K (3840×2160, 2x);
    • QHD (2560×1440, 3x);
    • FHD (1920×1080, 4x);
    • HD (1280×720, 6x).

    At resolutions divisible by three (QHD, HD), it’s even technically possible to simulate subpixel layout of pixels by representing each virtual subpixel as a physical pixel or a group of physical pixels.

Faster GPU is not a solution

There are cases when using a more performant CPU and/or graphics card (GPU) 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;
  • some games work incorrectly at 4K resolution (e. g. 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 built into the game;
  • in games based on pixel art, performance is not an issue, and the important thing is the pixelated nature of the image with no inappropriate blur not matching the intention of the game authors;
  • the computer performance does not matter if the video-signal source is not a computer, but e. g. a game console or a hardware video player.

Partial solutions

Scaling software

  • IntegerScaler — an application for scaling Windows games that support windowed mode.
  • GeDoSaTo (source code is available) — an application for scaling 3D games. 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.

  • nGlide — a Glide wrapper (emulator) — since the version 2.10 () supports nonblurry integer-ratio scaling: “Options” → “Aspect ratio” → “Integer scaling”.
  • dgVoodoo 2 (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)

  • Snes9x — a SNES emulator — since the version 1.56.2 () supports integer-ratio scaling: “Video” → “Display Configuration” (“Display Settings”) → “General” → “Integer Scaling”. To disable 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 scale 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.
  • Snes9x EX+ — a SNES emulator for Android — since the version 1.4.4 () supports integer-ratio scaling: “Options” → “Video” → “Screen Shape” → “Content Zoom” → “Integer-only”. To disable blur, switch the “Options” → “Video” → “Visuals” → “Image Interpolation” option to the “None” value instead of the default “Linear” value.
  • Mesen-S — a SNES emulator — supports integer-ratio scaling: “Options” → “Video” → “General” → “Use integer scale values when entering fullscreen mode”. To disable 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”.
  • bsnes-mt (improved version of bsnes) — a SNES emulator for Windows — has the “Pixel-Perfect” mode: “Settings” → “Output” → “Pixel-Perfect”. Unlike the “Center” mode in original bsnes, the “Pixel-Perfect” mode in bsnes-mt results in that scales 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 multiple languages (English is also available), and screen­shots are saved in the compressed PNG format instead of BMP.
  • bsnes — a SNES emulator — since the version 107 (), automatically uses integer-ratio scaling in the “Center” mode (“Settings” → “Output” → “Center”). To disable 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 scale (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)

  • Mesen — a NES emulator — since the version 0.9.1 () supports integer-ratio scaling: “Options” → “Video” → “General” → “Use integer scale values when entering fullscreen mode”. To disable 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”.
  • FCEUX — a NES emulator — supports full X+Y integer scaling in windowed mode, and it’s enabled by default: “Config” → “Video…” → “Windowed Settings” → “Force integral scaling factors”. Aspect-ratio correction can be enabled with the “Aspect ratio” → “TV Aspect” checkbox. In full-screen mode, integer scaling is not supported.
  • puNES — a NES emulator — since the version 0.105 () supports integer-ratio scaling: “Settings” → “Video” → “Misc” → “Use integer scaling in full­screen”. To disable blur, uncheck the “Interpolation” checkbox.

Game Boy, Game Boy Advance

  • mGBA — an 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 disable 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 () supports integer-ratio scaling: “Graphic Options” → “Scaling Mode” → “Retain Integer Factor”. To disable blur, make sure the option “Graphic Options” → “Scaling Filter” is set to the “Nearest Neighbor” value.

Multi­system emulators

  • RetroArch — a frontend for game-console emulators — supports integer-ratio scaling: “Settings” → “Video” → “Integer Scale”. To disable blur, set the “Settings” → “Video” → “Bilinear Filtering” parameter to the “Off” value.
  • BizHawk — an emulator of multiple game systems — supports integer-ratio scaling: “Config” → “Display” → “Scaling & Filtering” → “Expand pixels by integers only (e.g no 1.3333x)”. To disable blur, set the “Final Filter” parameter to the “None” value (default). But sometimes aspect ratio is wrong and pixel proportions are distorted.
  • MAME — an emulator of multiple game systems and old computers — supports integer-ratio scaling with no blur. Integer-ratio scaling can be enabled with the command-line parameter -nounevenstretch or its short version -noues. When game is running, integer-ratio scaling can be enabled via the menu opened with the Tab key: “Video Options” → “Screen #0” → “Non-Integer Scaling” → “Off”. 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 scales, 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%).

  • higan — an emulator of 8/16-bit game consoles — since the version 104 () supports integer-ratio scaling: “Settings” → “Video” → “Windowed Mode” / “Fullscreen Mode” → “Integral scaling”). To disable 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.
  • Mednafen — an emulator of multiple game systems and old computers — 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 disable 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

  • Mesen 2.0 — an in-development emulator of NES, SNES (Super Nintendo), Game Boy, PC Engine, Sega Master System, Sega Game Gear — supports integer scaling in full-screen mode: “Settings” → “Video” → “General” → “Use integer scale values when entering fullscreen mode”.

    To disable blur, the checkbox “Settings” → “Video” → “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: “Settings” → “NES / SNES / Game Boy / PC Engine / SMS” → “Video” → “Overscan”.

    In Windows build from , in SNES games, image is output at double resolution with width of 512 pixels, even if the game is using regular resolution with width of 256 pixels, so screen is used less fully than could be if real resolution of the game was used.

Other emulators

  • BlastEm — an emulator of the Sega Mega Drive (Genesis) game console — supports integer-ratio scaling. Can be enabled by setting the scaling option to the integer value instead of the default linear value in the configuration file C:\Users\USERNAMEAppData\Local\blastem\blastem.cfg.
  • DuckStation — an emulator of the Sony PlayStation (PSX) game console — supports integer-ratio scaling: “Settings” → “Display Settings” → “Screen Display” → “Integer Upscaling”. To disable blur, set the option “Settings” → “Enhancement Settings” → “Rendering Enhancements” → “Texture Filtering” to “Nearest-Neighbor” and make sure the option “Internal Resolution Scale” on the same settings’ page is set to “1x” (by default).
  • PCSX2 1.7+ (Qt version) — an emulator of the Sony PlayStation 2 game console — supports integer-ratio scaling: «Settings» → «Graphics» → «Display» → «Integer Scaling».
  • Cemu — 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” → “Nearest Neighbor”. A custom resolution can be set for some games via graphic packs: “Options” → “Graphic packs”.
  • WinUAE — an Amiga emulator — supports integer-ratio scaling: “Settings” → “Host” → “Filter” → the dropdown in the 3rd row, 3rd column → “Integer scaling” or “Auto Integer scaling”.
  • ScummVM — a modern software environment for running multiple old games like “Broken Sword” — since the version 2.1 () 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 which have their own integer-scaling implementations.

Modifications and FPGA implementations of old game systems and computers

  • PS1Digital ($160) — a modification kit/board for the game console Sony PlayStation (PSX) — supports integer scaling with output via HDMI at a resolution of 480p to 1080p (Full HD). The HDMI port replaces the “Serial IO” port. The mod kit can be installed into SCPH-550x and SCPH-700x models of any region based on the PU-18 and PIU-20 motherboards.
  • DCDigital (formerly DCHDMI) ($130) — a modification kit/board for the game console Sega Dreamcast — supports integer scaling with output via HDMI at a resolution of 480p to 1080p (Full HD). The mod kit can be installed into VA0 and VA1 models of any region with an icon consisting of 0 or 1 inside a circle on the sticker.
  • UltraHDMI — a modification kit/board for the game console Nintendo 64 — supports integer scaling with output via HDMI at a resolution of 480p to 1080p (Full HD). Delay with processing disabled is below 100 ns (0.1 ms). With processing (scanlines, crop, etc.) enabled, the average delay is 1 frame (16 ms). Review by RetroRGB.
  • Super Nt ($190), Mega Sg ($190) and Nt mini — FPGA-based semi­hardware analogs of the game consoles SNES (Super Nintendo), Sega Genesis (Mega Drive) and NES (Nintendo) corres­pondingly — support integer scaling with optional image cropping for maximum screen-height usage. The image is output via HDMI at the Full HD (1920×1080, 1080p) resolution.
  • MiSTer — a semi­hardware FPGA-based platform for creating functionally-precise replicas of multiple old game systems and computers — supports integer scaling. Can be enabled via the vscale_mode=1 parameter in the settings’ file MiSTer.ini. The image is output via HDMI at up to the Full HD (1920×1080, 1080p) resolution (video_mode=8 in MiSTer.ini), and up to 2048×1536 (video_mode=13) with over­clocking. Many cores support integer scaling both vertically and horizontally for preventing pixel shimmering. Many cores support cropping in Full HD output mode for fuller screen-space usage. MiSTer is based on the Terasic DE10-Nano development board ($170) that uses the FPGA SoC Intel/Altera Cyclone V.

OS virtualization

  • DOSBox-X — an improved unofficial version of the DOSBox emulator for running DOS applications — supports full integer scaling — with integer scales vertically and horizontally at the same time: “Video” → “Output” → “OpenGL Perfect”.

    Unlike the regular DOSBox, DOSBox-X features true scaling not based on filters, so nonblurry scaling in full-screen mode is supported, and scale is calculated automatically and not limited to low values (3x in the official DOSBox).

    Windows version of DOSBox-X is not declared as a DPI-aware application, so for fuller screen-space usage and more precise aspect ratio, DPI mode should be overridden to “Application” manually via executable properties before launching DOSBox-X.

  • DOSBox ECE — an improved unofficial version of the DOSBox emulator for running DOS applications — supports nonblurry integer-ratio scaling. Starting with the version r4318 (), the feature is unavailable, the latest version with support for pixel-perfect integer-ratio scaling is r4301 ().

    Unlike the regular DOSBox, the ECE version features true scaling not based on filters, so nonblurry scaling in full-screen mode is supported, and scale 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).

    Example of DOSBox ECE configuration file for the “Epic Pinball” game (click to expand)

    [sdl]
    fullscreen=true
    output=openglpp
    glfullvsync=true

    [cpu]
    cycles=4000

    [autoexec]
    mount C "."
    C:
    cd \EPICPIN
    PINBALL.EXE
    exit

  • DOSBox Staging — another DOSBox variant — 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. The feature is now removed, the latest version with support for both-axes pixel-perfect scaling is 0.80.1 ().

    The output parameter in the [sdl] section of the configuration file (*.conf) for the game, should be set to the openglpp or texturepp value. The scaler and glshader parameters in the [render] section should be set to the none value.

    Example of DOSBox Staging configuration file for the “Epic Pinball” game (click to expand)

    [sdl]
    fullscreen=true
    output=openglpp

    [render]
    scaler=none
    glshader=none

    [cpu]
    cycles=4000

    [autoexec]
    mount C "."
    C:
    cd \EPICPIN
    PINBALL.EXE
    exit

  • For DOSBox versions with support for shaders, there are shaders pixel_perfect.glsl and pixel_perfect-scanlines.glsl for full integer scaling — with integer scales vertically and horizontally at the same time, based on the author’s algorithm of the article author.
  • VirtualBox — a virtualization environment — supports nonblurry scaling of the virtual machine’s screen in the range of 100–300%: “Machine” → “Settings” → “Display” → “Screen” → “Scale Factor”.

Custom resolutions

In games and emulators that don’t support integer scaling, it’s sometimes possible for this purpose, to use custom resolutions combined with centered output via graphics card.

Prerequisites

  • The game must have a fixed resolution not changing while the game is already running.
  • The game resolution must be known in advance.
  • The game/emulator must support:

    • scaling with no blur, with the “Nearest Neighbour” algorithm;
    • stretching the image to entire screen on both axes without maintaining aspect ratio and with no black bars around. For resolutions that don’t need aspect-ratio correction, the ability not to maintain aspect ratio is not necessary.

How to use

  1. Calculate the size of the scaled image for the specific game or emulator at integer scales based on the resolution of the specific display (monitor or TV) (see the algorithm).
  2. In the control panel of the graphics card:

    • create a custom resolution equal to the calculated size of the scaled image;
    • choose:

      • scaling via graphics card (GPU);
      • centered output mode with no scaling.
  3. In the game or the emulator, choose a mode that stretches the image to the entire screen both vertically and horizontally, without maintaining aspect ratio and with no black bars around the scaled image.
  4. Switch the system screen resolution to the corresponding custom resolution.
  5. Play in full-screen mode.

Example

For example, if the game resolution is 320×240 and the screen resolution is 1920×1080 (Full HD), then the maximum integer scale is 4 and the required custom resolution is 1280×960:

1080 / 240 = 4.5 → 4

320 * 4 = 1280
240 * 4 = 960

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.

  • Owlboy () (an adventure platformer based on pixel art) — nonblurry scaling is built into the game.
  • QuakeSpasm (a Quake version powered by a more modern engine) — nonblurry integer-ratio scaling is built into the game since the version 0.93.0 () with support for scales 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 scale. 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.
  • Dusk () (a retro-style 3D shooter) — nonblurry integer-ratio scaling is built into the game with support for scales 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

  • XnView — an application for viewing images — supports scaling with no blur. To enable that, uncheck the checkbox “Tools” → “Options” → “View” → “High quality zoom” → “Enlarge”. Limitation: the option is applied to all viewed images regardless of the ratio of their size to the size of the viewer window and using full-screen mode. Limitation (unrelated to scaling): doesn’t support viewing images that have file names with characters different from alpha-numeric latin characters and corresponding to the main system language.
  • MPC-HC — a player for playing videos — supports scaling with no blur. To enable that, use 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 the ratio of their frame size to the size of the player window and using full-screen mode. After releasing the version 1.7.13 (), original MPC-HC was discontinued, 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. To force DPI scaling in Windows 10 for a game even if the game is declared as HiDPI-compatible (DPI-aware), override DPI mode to the “System” value in properties of the game’s executable file (*.exe), see details below in the next section;
    • the “Borderless” mode must be chosen in the game settings. In different games, this mode may be called differently, e. g.:

      • Borderless,
      • Borderless Full Screen,
      • Borderless Windowed,
      • 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 equal to the OS-level zoom 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

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.

In order to enable DPI scaling instead of disabling it, for a specific game in Windows 10 for the purpose of scaling in border­less mode, select the “System” item instead of “Application”.

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

  • There is reportedly (1, 2, 3, 4) no blur in the “Graphics” mode in some models of 4K TVs by Sony — e. g. 65″ model of the X900E series, 55″ model of the X900H series, and 42″ OLED TV of the A90K series (2022). The mode can be enabled in settings of the TV: “Settings” (⚙️ button on the remote control) → “Display & Sound” → “Picture” → “Basic” → “Picture mode” → “Graphics”. But when variable refresh rate (VRR) is enabled, the picture mode is reportedly locked to “Game” which adds blur at non-native resolutions.
  • 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. According to HDTVTest, the 65-inch TX-65JZ2000B OLED TV of the JZ2000 series () lacks this feature.
  • There is reportedly (1, 2) no blur in the “Computer” input mode at resolutions of 1920×1080 (Full HD) and lower in some models of 4K TVs by TCL based on the Roku TV platform with firmware from  — e. g. 65R625. But at least at 1920×1080 resolution, there is some smoothing on edges of solid-color areas.

Arcade machines

  • iiRcade home arcade machines support integer scaling (“pixel perfect filtering”) since the software update 9.008. The mode is enabled by default.
  • Arcade1Up home arcade machines, at least Killer Instinct, support integer scaling. Can be enabled with the option “Integer scaling” → “On” in settings, per game (Killer Instinct 1/2, BattleToads, etc.). The “Smoothing” option alongside the “Integer scaling” one should probably be set to “Off” to prevent blur.

Miscellaneous

  • SmartUpscale — an extension for Firefox and Chrome browsers for disabling unreasonable blur of images on web pages.
  • There is reportedly no blur when using full-screen scaling with integer ratios via the official Intel’s graphics driver for Linux operating system.
  • gamescope — a compositing window manager for the Debian-Linux-based operating system SteamOS — supports integer scaling when using graphics cards based on AMD GPUs. Can be enabled with the command-line option -n or via the keyboard shortcut Super+N.
  • Raspbian — an operating system for Raspberry Pi mini computers — since , 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) handheld consoles, pixel-perfect scaling can be enabled by holding the Start or Select button when launching the game.
  • Zisworks ZWS — DIY modification kits for 4K monitors and TVs — support integer-ratio scaling with scales up to 400%. An almost zero lag of 30 μs is stated. Following kits are available:

    • X28 Rev2 ($505) for 28″ Samsung U28H750 (2017, TN) monitor, premodified monitors are available ($1160);
    • X28 Rev2 (Generic) ($495) for 28″ Innolux M280DGJ-L30 panel (2013, TN);
    • X39 Rev2 ($525) for 39″ Seiki SE39UY04 TV (2017);
    • X40 Rev2 ($425) for 40″ Philips BDM4065 monitor (2014);
    • X39 Rev2 ($490) for other 39″, 40″ and 42″ panels.

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. The same limitation takes place with the Samsung UN55NU8000 TV set. Also, scaling via GPU is impossible if the signal source is not a computer, but a game console or a hardware video player.
  • 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;
    • DCDigital 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. There is information that scaling to the 4K resolution needs an FPGA with a clock speed of at least 600 MHz.

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 a 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

The author’s algorithm of integer-ratio scaling. An algorithm is a sequence of actions for achieving the needed result. For a ready-to-use implementation, see the IntegerScaling library (C++/Rust/JS/PHP).

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.

As a mathematical formula, this can be represented this way:

With aspect-ratio correction

  1. 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.
  2. 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.
  3. If the area aspect-ratio is equal to the target one, the needed integer ratios are equal to the maximum ones.
  4. 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.
  5. 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

  1. 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.
  2. If aspect-ratio correction is not needed (pixels are square, horizontal and vertical scales are equal):

    1. The integer scale R is the less of the ratios MRX and MRY.
    2. 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.
    3. 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.
  3. If aspect-ratio correction is needed (pixels are potentially rectangular, horizontal and vertical scales are potentially different):

    1. 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.
    2. Divide the width MW of this area by its height MH, that results in the aspect ratio MA of the area.
    3. If the ratio MA is equal to the target aspect ratio TA:

      1. Assign the scales RX horizontally and RY vertically the values of MRX and MRY correspondingly.
      2. Go to centering the scaled image (the step 4.1).
    4. If the ratio MA is lower than the target aspect ratio TA:

      1. Assign the horizontal scale RX the value of MRX.
      2. Divide the maximum width MW by the target aspect ratio TA, that results in an approximate scaled height AUH.
    5. If the ratio MA is greater than the target aspect ratio TA:

      1. Assign the vertical scale RY the value of MRY.
      2. Multiply the maximum height MH by the target aspect ratio TA, that results in an approximate scaled width AUW.
    6. 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 scales on different axes are closer to each other, the pixel shape is closer to a square). The resulting integer is the scale on this axis — RX (horizontal) or RY (vertical).
    7. 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 scales RX horizontally and RY vertically correspondingly.
  4. Center the scaled image on the screen:

    1. 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.
    2. Display the scaled image at a distance of X horizontally and Y vertically from the top-left corner of the screen.
  5. Fill the rest screen space around the scaled image with black.

Reference implementation

The author’s library IntegerScaling is the reference software implementation of the algorithm in multiple programming 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 scale 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 scale 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 (55 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:

  1. for disabling blur regardless of whether the scale is integer or fractional — this just results in using the “Nearest neighbour” algorithm instead of bilinear interpolation;
  2. for using solely integer scales 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 and a delusion. A crucially important use case of integer scaling is playing modern 3D games at the Full HD resolution on a 4K display with no unreasonable quality loss compared with a Full HD display of the same size. In near future — scaling QHD (3x) and 4K (2x) to 8K.

A lower-than-native resolution may be used for the purpose of increasing performance in games (especially on laptops) or in games that work incorrectly at the native screen resolution, and also for running HiDPI-incompatible software that has graphical or functional issues with DPI scaling in Windows.

Also, integer scaling is useful for preventing quality loss when watching videos.

Is this the same as “Nearest Neighbour”?

Only partly. The results of using the “Nearest Neighbour” algorithm and integer-ratio scaling are only identical at integer scales — e. g. 2 or 3.

  • At fractional scales (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.
  • With integer-ratio scaling, the scale 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, disable upscaling blur in display or graphics-driver settings, and 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 native 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. With low-quality or disabled anti­aliasing, pixels are noticeable regardless of whether scaling is blurry. This author plays games at Full HD with IntegerScaler and watches Full HD videos with MPC-HC on the 24″ 4K monitor Dell P2415Q on a regular basis. Now imagine integer scaling of QHD or 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 use it at Full HD anyway?
  • Computers have multiple use cases. In many of them, the 4K resolution gives an advantage while performance is not an issue:

    • 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 sequential flickering of sub­pixels caused by crystal inversion specific to the LCD technology;
    • 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 (dithering).
  • 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.
  • 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: 4K (3840×2160, 2x), QHD (2560×1440, 3x), FHD (1920×1080, 4x), HD (1280×720, 6x).
Does FHD on 4K monitor with integer scaling look like on FHD monitor?

Yes. Moreover, games and videos at FHD with integer scaling on a 4K monitor look even better than on a monitor with native FHD resolution, e. g. inter­pixel grid is invisible and crystal-inversion flickering is almost unnoticeable.

The only special case is subpixel text anti­aliasing that only works at native resolution because it relies on specific subpixel layout:

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 resolution 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).

Does integer scaling improve performance?

No. Integer scaling just prevents blur. What improves performance is using a lower resolution — regardless of whether there is blur. Both regular scaling with blur and integer scaling with no blur don’t affect performance.

But thanks to its computational simplicity, integer scaling may decrease input lag compared with scaling algorithms that calculate average colors of pixels.

What is better: lower resolution with no blur or higher resolution with blur?

At a lower resolution upscaled with no blur (e. g. FHD→4K), the image is sharper. At a higher resolution upscaled with blur (e. g. QHD→4K), the image is more detailed, though blurry to some extent due to logical pixels not aligned with physical pixels.

Integer scaling allows to prevent unreasonable blur when the native/logical resolution ratio is integer. But if the computer performance is enough for using a higher resolution and the game works correctly at that resolution, it may make sense to use the higher resolution, especially if anti­aliasing quality in the game is low.

Isn’t this built into OpenGL and DirectX?
In the 3D rendering APIs like OpenGL (the GL_NEAREST mode) and DirectX (D3DTEXF_POINT in Direct3D 9), 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 integer scaling by graphics card does not contradict with support by display, and vice versa.

  • Even if new displays start supporting nonblurry scaling, this won’t help owners of existing displays, while scaling via graphics card will.
  • Scaling via graphics card is not available if the video-signal source is not a computer, but e. g. a game console (Nintendo Switch, PlayStation 3/4, MiSTer FPGA, Super Nt, Mega Sg, SNES Mini) or a hardware video player.
  • When scaling via GPU (graphics card), 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.

    For example, when connecting via HDMI 1.x, the maximum refresh rate at the 4K resolution is 30 Hz, while at Full HD it’s 120 Hz. When scaling via GPU, the rate would be limited to the same 30 Hz like at true 4K, even if the logical resolution before scaling is Full HD.

  • In case of nVidia GPUs, integer scaling is only available for modern graphics cards starting with the Turing generation (2019) (RTX and GTX 16*) and only under Windows 10 and newer.
  • Speci­fically the implemen­tation of integer scaling in nVidia graphics driver has multiple serious limitations including incompati­bility with HDR, custom resolutions, 4:2:0 chroma subsampling, tiled mode (used in Dell UP3218K 8K monitor).
  • AMD stopped releasing graphics drivers for Windows 7, so integer scaling via GPU will most likely not be available in Windows 7 with GPUs released after that. The display’s own scaling works regardless of the GPU model and the versions of operating system and graphics driver.
  • GPU scaling reportedly increases input lag.
  • GPU scaling does not work during computer boot and in BIOS.
  • 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 better?

The DLSS upscaling method is not a universal solution:

  • available only on modern nVidia GPUs;
  • requires individual support by each specific game. Absolute majority of games don’t support DLSS. Integer scaling works with any game;
  • may introduce unpredictable image artifacts. Integer scaling upscales the image as is, without altering it in any way;
  • based on machine learning and computationally-intensive. Integer scaling requires basically zero computational power;
  • intended for 3D games and not applicable to games of other types — e. g. based on pixel art. Integer scaling is applicable to any image;
  • unavailable if the signal source is not a computer, but e. g. a game console or a hardware video player.
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 scale.

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 (AMD Software: Adrenalin Edition) (19.12.2, ) for Windows 7/10.

How to enable integer scaling

Integer scaling can be enabled by switching the “Integer Scaling” option to the “Enabled” value on the “Gaming” → “Display” page, or ⚙️ → «Display» in AMD Software versions older than 23.7.1 (). It’s also possible to override the scaling mode for a specific game in its properties on the “Gaming” → “Games” page.

Before enabling integer scaling in AMD control panel, GPU scaling must be enabled on the same page of the control panel. Otherwise “Not supported” is displayed for the “Integer Scaling” option, and it cannot be enabled.

When integer scaling is enabled, the “Scaling Mode” option is ignored.

Advantages: compatible with older GPUs, Windows 7, and sharpening

  • Unlike Intel and nVidia that only support integer scaling for GPUs of 2019 and newer, the AMD implementation supports the feature for GPUs of multiple previous generations starting with the 2nd-generation GCN architecture () including GPUs of the R7 260, R9 285 and R9 290 series.
  • Unlike Intel and nVidia that only support integer scaling in Windows 10 and newer, the AMD implementation also supports Windows 7. Starting from the version 21.6.1 (), new versions of AMD graphics drivers for Windows 7 are not released on a regular basis anymore, the last version with Windows 7 support at that moment was 21.5.2 (). But a year later, new version 22.6.1 (2022-06-23) was released with Windows 7 support, that made RX 6000-series GPUs compatible with Windows 7.
  • Unlike nVidia, the AMD implementation of integer scaling allows to combine integer scaling with sharpening (Radeon Image Sharpening, RIS).

Limitations

  • Integer scaling is reportedly not available when using built-in display on laptops with integrated GPU built into AMD CPUs called APU. The feature is available with an external display.
  • 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.
  • A user of Radeon RX 5700 XT () 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 () 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.
  • When using GPUs of the RX 500 series and maybe others, when logical and native resolutions are not divisible, the scaled image is aligned to top instead of centering vertically. The author of this article encountered this issue with RX 550 GPU with AMD graphics drivers at least up to version 23.2.1 () inclusive.
  • A user reported that stress tests with integer scaling enabled, resulted in crashes with AMD graphics-driver versions up to 20.11.2 (), the issue does not reproduce anymore since that version.
  • A user reported that the option for enabling integer scaling in the AMD control panel is unavailable with GPUs of the 6000 series, namely RX 6600 XT and Radeon PRO W6600. According to experience of the author of this article, this does not reproduce with RX 6400 GPU at least with AMD graphics driver versions 23.3.1 () and newer.
  • The author of this article, encountered distorted proportions with RX 6400 GPU when using integer scaling at resolutions with non-16:9 aspect ratios — e. g. 640×480, 800×600, 1024×768, 1280×1024 — the image was stretched vertically and/or compressed horizontally. The issue reproduced at least up to AMD graphics driver version 23.2.2 () inclusive. At least starting from AMD graphics driver version 23.3.2 (), the issue does not reproduce anymore.
  • Starting with the version 20.1.4 (), an issue was fixed, that previously resulted in the feature being not available on some Windows 7 systems.

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 kept growing even after feature implementation.

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 , 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 .

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 (). The stable version 26.20.100.7212 was released . Support for the feature was originally announced by Intel on . On , 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
Screenshot of the “Retro Scaling” option in Intel Graphics Command Center

“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 , 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) ().

The feature can be enabled via the option “Integer scaling” in the list “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;
    • in the “Tiled” mode. The mode is used e. g. in the Dell UP3218K which is the only 8K monitor on the market;
    • in conjunction with custom resolutions;
    • when using 4:2:0 chroma subsampling (YUV420) (supported color formats: RGB, YUV444, YUV422);
    • with DSR enabled;
    • with nVidia Image Sharpening (441.08+, ) 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.
  • According to release notes, using the current implementation of the feature in conjunction with the HDR mode may lead to system crash (BSOD) or system hang when changing the resolution while using integer scaling. Later, a user confirmed that HDR works correctly when using RTX 4090 GPU based on the “Ada Lovelace” architecture ().
  • 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.
  • 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 scale 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.
  • A user of RTX 2080 Ti GPU reported that when using graphics driver 531.61 () under Windows 10 x64, integer scaling sometimes stops working, a workaround is turning it off, then on again in nVidia control panel.
  • A user of an RTX 3080 Founders Edition graphics card reported that integer scaling does not work for them at all.

It’s unknown whether the limitations listed above were fixed in the new RTX 3000 series of 2020 based on the Ampere architecture. There is a corresponding question thread on the nVidia forum, from .

Some users say they are able to use integer scaling together with HDR, custom resolutions and 4:2:0.

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 () 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;
  • 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;
  • ViewPortIn is the size of the rendering area in logical pixels;
  • ViewPortOut 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 only works with windowed and pseudo-full-screen (rendered over OS desktop) games. The scaling is not applied to 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 () 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;
  • 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 21.04 still come by default with the outdated XRandR version 1.5.0. This version supports scaling, but does not support disabling blur. 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 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 () 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 — Eve/Dough Spectrum 4K and QHD monitors

Already implemented and tested

Eve/Dough Spectrum are the world’s first computer monitors with built-in pixel-perfect (integer) scaling. The feature is already implemented and does work: tested by yours truly.

The 4K model with refresh rates up to 144 Hz is already in production and is being shipped to customers reserved the monitor. Also planned are two models with QHD (2560×1440) resolution and refresh rates up to 144 Hz and 240 Hz correspondingly. The 240 Hz model is going to be available in , the 144 Hz model — in .

The monitors are based on LCD panels “Nano IPS” produced by LG Display, with a response time of 1 ms and support for variable refresh rate (VRR) “FreeSync Premium Pro” (“G-Sync Compatible”) with a minimal rate of 48 Hz and high dynamic range (HDR): HDR600 for the higher-level models and HDR400 for the lower-level one.

Limitations

When using the firmware version 107 (), the latest one at , there are the following limitations.

  • Integer scaling only works at predefined resolutions. At other resolutions, the image is centered without scaling, like in the centered mode (“1:1”).
  • When low-latency mode or variable-refresh-rate mode (“Adaptive-Sync”, “VRR”) is turned-on in the monitor settings, integer scaling does not work, the image is instead stretched to entire screen without maintaining aspect ratio, like in the “Stretch to fill” mode. In this case, turning-in integer scaling in monitor settings just turns-off blur.

Similar model by LG does not support integer scaling

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

, this article was visited from a service (presumably mail) LG server, that gives us a hope that LG is now aware of integer scaling.

Standalone scalers

RetroTink-4K ($750)

RetroTink-4K (RT4K) is a scaling device based on FPGA. Announced on . Developed by Mike Chi. Available since late for $750.

Maximum output resolution is 4K (3840×2160) at refresh rate of 60 Hz with full color resolution of 4:4:4 without chroma subsampling. Output of Full HD (1080p), QHD (1440p), and 480p is also supported. Custom video modes can be added via text files on SD card. It’s possible to store up to 65.5 thousands user profiles on SD card.

Supports both integer scaling and simulation of image specific to CRT displays, including scanlines. Supports high dynamic range (HDR) for brightness-loss compensation when simulating CRT.

There are digital HDMI input and analog inputs including SCART, component, S-Video, and HD-15 (VGA). HDMI input supports arbitrary video modes within available bandwidth, including modes available via MiSTer DirectVideo.

Power is delivered via a USB-C port (5V, 2A). The device is controlled via a remote control.

Morph 4K ($400–500)

Pixel FX Morph 4K is a modular scaling device based on FPGA. Announced on . First-batch shipping is expected in Q1 . The module with analog inputs is expected to release in Q2 . Preorder is available. Announced prices are $400 and $500 for versions without and with analog inputs correspondingly.

Maximum input resolution is 4K (3840×2160) at refresh rate of 60 Hz with full color resolution of 4:4:4 without chroma subsampling. User profiles can be saved on MicroSD card.

Supports both integer scaling and simulation of image specific to CRT displays, including scanlines. Supports polyphase upscaling for filling the screen as entirely as possible. Supports HDR, VRR, BFI.

HDMI input supports resolutions from 240p to 1080p.

Basic version only has digital HDMI input. With additional “Analog Bridge” module, analog inputs are available: two VGA, SCART, component, 5-BNC.

USB-A port allows to control other devices.

Upgrading firmware is supported via both MicroSD card and Wi-Fi.

Similar and hybrid scaling methods

There are scaling methods that use integer scaling partially and/or give similar results.

Vertically integer

The vertical scale is integer, the horizontal one is fractional. The following are achieved:

  • an aspect ratio precisely matching the target aspect ratio with aspect-ratio correction enabled;
  • uniform scanlines’ distribution vertically.

But horizontally, there is either distortion (if the “Nearest neighbour” algorithm is used for horizontal scaling) or blur (if bilinear inter­polation or a similar algorithm is used for horizontal scaling).

Example
  • SNES emulators bsnes and bsnes-mt in the “Center” mode.

Depending on resolution divisibility

With this approach, different scaling algorithms are used depending on divisibility of sizes (resolutions) of the original image and the area the scaled image should fit into:

  • with no blur — at divisible sizes: e. g. FHD on 4K monitor, the scale is 2.0;
  • with blur — at nondivisible sizes: e. g. FHD on QHD monitor, the scale is 1.333.

So:

  • if the size ratio is integer (2.0 in case of FHD→4K), there is no unreasonable blur, and sharpness is maximum;
  • if the size ratio is fractional (1.333 in case of QHD→4K), all pixels of the original image are averaged, and there is blur;
  • in both cases, the scaled image corresponds to the original one, there is no distortion;
  • the size of the scaled image is always equal to the size of the area it fits into, black background is not added around the scaled image.
Examples
  • Scaling user interface of applications with the DPI virtualization (DPI scaling) mechanism in Windows 10.
  • Web-browser extension (addon) Smart­Upscale for integer scaling of images on webpages.

Pixelation with blurred pixel edges

Pixelated image with physical pixels of average colors on edges of logical pixels. Implemented with the algorithms “Sharp Bilinear”, “Pixellate” and “AANN” (“Anti­Aliased Nearest Neighbour”), that give slightly different, but generally similar results.

Sharp Bilinear is two-stage scaling:

  1. integer scaling with no blur;
  2. streching to the screen size with blur.

The following results are achieved simulta­neously:

  • maximum filling of the screen;
  • an aspect ratio precisely matching the target aspect ratio;
  • partial pixelation;
  • no noticeable pixel shimmering.

But edges of logical pixels are blurry, so sharpness is lower compared with pure integer scaling.

Examples

Shaders (image-post­processing subprograms running on GPU) “Sharp Bilinear”, “Pixellate” and “AANN” in emulators:

  • SNES emulators bsnes and bsnes-mt in “Center”, “Scale” and “Stretch” modes;
  • libretro frontend RetroArch.