Pixel perfect problems once again.

I've been through this problem already, but after moving to MV it did absolutely not get any better. So basically I removed the blur from my game (in retrospect I don't really remember how I did this since I don't have any problems), but I've ran into a problem; stretching pixels: basically just how it happened in this post, from which I also tried borrowing the code. Though when I added it to my project as a plugin, my game stopped working entirely (when I playtest it just shows a black screen) though it's understandable since it was written for MZ. Does anyone know any plugins to fix this problem? (I think there must be a way around it since I don't see much people having this problem...)

(if this matters, my game resolution is 600x800)
If that code was specifically written for MZ, there's obviously a good chance it won't work in MV. Of course this isn't always the case since the engines are similar.

Are you looking to try and fix that code? Or are you looking for a resolution plugin specifically for MV?

Edit:
I found this, if that's helpful.
Are you looking to try and fix that code? Or are you looking for a resolution plugin specifically for MV?
I'm not really familiar with JavaScript but tbh I expected the code to not work :// and yeah I'm trying to find a plugin or different piece of code that could fix this
Edit:
I found this, if that's helpful.
I assume you mean the 2nd point (I also tried with and without the first one) but both don't seem to help. Also I think I should include screenshots that show my issue

So this is a sprite in windowed mode, in the default resolution:
Zrzut ekranu 2025-03-29 133018.png

And here's the same sprite in fullscreen/when the screen gets stretched:
obraz_2025-03-29_133441260.png

I think it has something to do with the resolution, but I'm not 100% sure since I've been having this problem ever since I started working on this game
You mean 800x600? I don't think that script'll help you much unless you have a 4k monitor.

This is the MV version of it.
JavaScript:
Graphics._updateRealScale = function() {
  if (this._stretchEnabled && this._width > 0 && this._height > 0) {
      const h = window.innerWidth / this._width;
      const v = window.innerHeight / this._height;
      this._realScale = Math.min(h, v);
      window.scrollTo(0, 0);
  } else {
      const h = window.innerWidth / (this._width);
      const v = window.innerHeight / (this._height);
      var pixelLockedScale = Math.min(h, v);
      pixelLockedScale = Math.floor(pixelLockedScale);
      this._realScale = Math.max(pixelLockedScale, 1);
      window.scrollTo(0, 0);
  }
};

Graphics._defaultStretchMode = function() {
  return false;
};
Now that I'm thinking about it, it might be helpful to know a couple of things about resolution.

Your game's resolution doesn't really change when you go into full screen mode. It's rendering the game at that scale, but it's just blowing the image up. What you're looking for is a resolution that scales nicely with the target full screen resolution. Assuming a standard full screen resolution of 1920x1080, a good game resolution would be 640x360 since you can multiply that by a nice whole number to get 1920x1080. The reason you want to multiply by whole numbers is because this maintains the "pixel perfect" look. 640x360 gets blown up by 300% (each multiplied by 3) and the pixels stay at a nice, even, ratio that doesn't distort the the "pixel perfect" square.

800x600 (I'm assuming you actually mean 800x600 since most screens today are wider than they are tall) getting blown up to 1920x1080 means that your original image is being scaled up to a strange ratio since you can't multiply both 800 and 600 by the same number to reach 1920 and 1080, respectively. So your pixel "squares" get stretched and look weird, resulting in what you've shown us.

The general rule of thumb is that you want to be able to multiply the both of your initial resolution numbers by the same number in order to reach your desired full screen resolution (640x3=1920, 360x3=1080).


Now that we know that:

Your problem might actually be solved if you simply change your game's original resolution to something bigger or smaller that can be scaled evenly with your target full screen resolution. Keep in mind that this might mean you have to make some edits to the map since the player will be able to see further or not as far as you originally intended depending on the change you make.


Common Pixel Canvas Sizes:

Common 16:9 (normal, modern monitors have 16:9 pixel ratios and include 4k monitors) pixel canvas sizes that can be blown up to full screen without losing pixel fidelity are 320x180, 480x270, 640x360, and 1280x720.

Common 4:3 (older "square" monitor pixel ratio) pixel canvas sizes that can be blown up to full screen without losing pixel fidelity are 320x240 and 640x480. Keep in mind that if you use one of these resolutions, you'll get black bars on the edges of your screen, much like an older TV show will on newer TVs. ...or it might just stretch it to be full screen and everything would look "fat". I've not made something in RPG Maker in 4:3 yet.

Does that help at all?
Thanks y'all for help!! the code worked and lowering the resolution actually made it look even better <33

Original thread: https://forums.rpgmakerweb.com/threads/pixel-perfect-problems-once-again.176575/