(SOLVED) RPG Maker MZ won't allow me to turn off DPI scaling

I've recently upgraded from RPG Maker VX Ace to RPG Maker MZ, and so far I can't seem to fix a certain issue I'm having. I use a Lenovo Legion 5 laptop, and I use the 125% DPI scaling option so that things are roughly the same size as they would be on the normal monitor. I've noticed that RPG Maker MZ seems to also use the scaling, which ruins the pixel art in both the editor and when playtesting. Normally this is fixed by right clicking on the exe and choosing "Properties->Compatibility->Change high DPI settings" and enabling the override, however for whatever reason RPG Maker MZ just doesn't seem to react to this option. I verified that turning off the scaling in Windows 10 settings fixes the issue, but it makes everything except RPG Maker very hard to use. Is there anything I could do to make it look normal again?
Thanks in advance.

Attached screenshots:
1 - how the game looks for me with DPI scaling + a closeup of the pixels
2 - how the game looks when played on a computer with DPI scaling off + a closeup of the pixels
Which exe did you change the settings of, exactly? If you tried it with RPGMZ.exe: may I suggest you try it with nw.exe instead?

<Path>\RPG Maker MZ\nwjs-win\nw.exe

EDIT: never mind, it doesn't help either... hmmm...
I've tried messing with pretty much every single exe I could find, and none of them fixed the issue. The only thing I've noticed is that at one point resizing the game window would make scroll bars appear at the right and bottom of the window for a few milliseconds before disappearing again. In the meantime I set up a Windows 10 VM to use MZ in so I can keep my 125% scale on everything else, but that's a bandage solution and it performs really poorly (about 1/3 of normal game speed).
If you deploy your project then change the settings on that executable, is it any different?

I'm just wondering if it's not something within the browser, rather than the executable itself.
If you deploy your project then change the settings on that executable, is it any different?

I'm just wondering if it's not something within the browser, rather than the executable itself.
The deployed exe is also affected by scaling and also doesn't respond to the override, so the exact same case as the playtest.
I rather suspected that would be the case.

So it's not about the executables, it's about something in the browser's graphics rendering that's looking at your Windows scaling settings.

That's beyond my ken, maybe @caethyril would have a suggestion.
document.getElementById('gameCanvas').style.imageRendering = 'pixelated'

...is probably the fix you're looking for. The canvas smoothing is a browser default, that you were only coincidentally not seeing at 100% DPI scaling. Basically, it's a CSS issue and not a JS or EXE issue, so changing game.css is also an option.
The game app is at root a Chromium browser: you can disable its scaling using the appropriate command-line argument. That can be done via the manifest file, i.e. your project's package.json. Add the following to the chromium-args field in that file:

--force-device-scale-factor=1
E.g. default manifest plus this edit:
JSON:
{
    "name": "rmmz-game",
    "main": "index.html",
    "chromium-args": "--force-color-profile=srgb --force-device-scale-factor=1",
    "window": {
        "title": "Game Title",
        "width": 816,
        "height": 624,
        "position": "center",
        "icon": "icon/icon.png"
    }
}
Note that the editor resets the manifest to default whenever you save your project. You can save your project, make the manifest edit, then launch playtest to avoid this. For deployment you may have to edit the deployed manifest file, I haven't checked.
The game app is at root a Chromium browser: you can disable its scaling using the appropriate command-line argument. That can be done via the manifest file, i.e. your project's package.json. Add the following to the chromium-args field in that file:

--force-device-scale-factor=1

E.g. default manifest plus this edit:
JSON:
{
    "name": "rmmz-game",
    "main": "index.html",
    "chromium-args": "--force-color-profile=srgb --force-device-scale-factor=1",
    "window": {
        "title": "Game Title",
        "width": 816,
        "height": 624,
        "position": "center",
        "icon": "icon/icon.png"
    }
}
Note that the editor resets the manifest to default whenever you save your project. You can save your project, make the manifest edit, then launch playtest to avoid this. For deployment you may have to edit the deployed manifest file, I haven't checked.
Adding that to the manifest did indeed fix this issue, thanks a ton! Is there anything that's preventing me from making the manifest read only after adding this, so that I won't have to edit it every time? I barely have any MZ experience, but to me it doesn't look like there's anything in there that would change when editing the game aside from the title, resolution, and maybe position and icon?
If you're concerned more about the pixelation itself than the slightly increased window size, add these lines to css/game.css, and that will disable the bilinear scaling entirely.
#gameCanvas { image-rendering: pixelated; }

I also have an old, unreleased plugin (~20 lines) that does the above and locks the canvas to a 1:1 pixel aspect ratio in fullscreen mode, but I was never entirely sure if enough demand existed to release it.
I just tried setting the manifest to read-only and the editor gave me a warning on save, "unable to write to file package.json". Didn't crash or prevent playtest, though, so it's probably OK.

Note that disabling automatic DPI scaling doesn't stop users from scaling the game in other ways, e.g. by entering full-screen (F4) or manually resizing the window. If you're concerned about how the game is rendered, I recommend following Lone Wolf's suggestions~

Original thread: https://forums.rpgmakerweb.com/threads/solved-rpg-maker-mz-wont-allow-me-to-turn-off-dpi-scaling.161195/