MV Two plugins are scaling differently???

So, basically, im using a simple script i found somewhere to force nearest neighbor scaling for some things, and it works, except when it doesn't. I'm using this:
PIXI.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST
ImageManager.loadBitmap = function(folder, filename, hue, smooth) {
if (filename) {
var path = folder + encodeURIComponent(filename) + '.png';
var bitmap = this.loadNormalBitmap(path, hue || 0);
//console.log("disabling smoothing for "+path);
bitmap.smooth = false; return bitmap;
} else {
return this.loadEmptyBitmap();
}
};

And with the breathing animation from rexal's animatedSVEnemies it uses nearest neighbor scaling, which is nice, cool, exactly what i want. But then using SRdude's walk character battlers, the scaling is awfully blurry to the point of ruining the art style. i'm not sure why this is happening, or if there's any fix for it that isn't completely recoding the plugin.

Example:
difference.png
Is your loadBitmap override plugin loading after the others (Rexal/SRD) in the Plugin Manager?

I'd suggest something like this instead, for a better chance of compatibility:
JavaScript:
/*:
 * @target MV
 * @plugindesc Nearest-neighbour scaling for all bitmaps.
 * @help Free to use and/or modify for any project, no credit required.
 */
void (function() {
  var alias = ImageManager.loadBitmap;
  ImageManager.loadBitmap = function(folder, filename, hue, smooth) {
    return alias.call(this, folder, filename, hue, false);
  };
})();
I.e. call the original loadBitmap as usual, except smooth = false in all cases. Again, this should be loaded after any other plugin that changes loadBitmap.
I.e. call the original loadBitmap as usual, except smooth = false in all cases. Again, this should be loaded after any other plugin that changes loadBitmap.
I replaced the older nearest neighbor plugin i was using with that, and changed the order, but still no dice. I'm pretty confused. i have a feeling somehow SRD's plugin is scaling things differently? i'm not a coder, but it doesn't call loadBitmap at all
Drat. There have been discussions about getting pixel-perfect graphics in RMMV, but I don't remember what the solutions were. Hopefully I'm missing something. 😴

Ideas:
  1. What's the width/height (px) of each of those sprites? I notice some code in SRD's plugin that seems to give sprites with odd (i.e. not a multiple of 2) frame width a fractional x value. Not sure how nearest-neighbour scaling handles that.

  2. I notice Rexal's plugin actually sets smooth to true on the enemy sprites (line 372), i.e. it seems to be using linear scaling, not nearest-neighbour. Perhaps that's causing the conflict in some way...?

  3. Have you tried:
    • Turning off all plugins except SRD's?
    • Turning off all plugins except Rexal's?
    • Turning off all plugins except the SRD and Rexal ones?
    • Changing which of the SRD/Rexal plugins loads first?
    As always, remember to save your project to apply Plugin Manager changes before each test.
i have a feeling somehow SRD's plugin is scaling things differently? i'm not a coder, but it doesn't call loadBitmap at all
Not directly: it calls ImageManager.loadCharacter, which calls loadBitmap. Then it looks like it blits it to a new bitmap for some reason. (I don't think that'll be a problem, though, because the core scripts have new bitmaps default to "not smooth", i.e. nearest-neighbour scaling.)
  1. Have you tried:
    • Turning off all plugins except SRD's?
    • Turning off all plugins except Rexal's?
    • Turning off all plugins except the SRD and Rexal ones?
    • Changing which of the SRD/Rexal plugins loads first?
    As always, remember to save your project to apply Plugin Manager changes before each test.
I tried all of these things, to no avail.

I even made a dedicated plugin with just the forced nearest scaling plugin and SRD's walk sprite battling one, and it has the same result:
RESULT.PNG


I have no idea why it's happening with specifically this plugin and not any others but at this point I might just try something else for the battle system
Small update: I went back to this, could still absolutely not get the scaling in SRD's plugin to work the way i want, but i realized I could just scale up the walksprites manually and have a second sprite sheet for that and.. it works perfectly!

yay.PNG


still very confused why i couldnt get it to do clean scaling in the first place, but ah well. i figured something out

Original thread: https://forums.rpgmakerweb.com/threads/two-plugins-are-scaling-differently.151639/