Anyway to load a custom library in MV?

I've been working along with my programmer on a plugin, and it uses png files. There's a loss of transparency when the png files are saved/compressed, creating a faint outline around them. We want no quality loss to the images, so we've been looking into solutions.

So my programmer says he can get around it using a different library, but he doesn't know how to load a custom library in MV. For example, he'd like to load this one. Is it possible, and if so, how?

If there is no way to load said library is there any way to save png files using "toDataURL("image/png", 1)" without any loss of transparency?
I don't know, but I will write in this thread to get updates from it because that sounds pretty cool from what I understood.
So my programmer says he can get around it using a different library, but he doesn't know how to load a custom library in MV. For example, he'd like to load this one. Is it possible, and if so, how?
very simple way in the index.html file symply download the JS libs
and Add to your custom Html file
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="user-scalable=no">
<link rel="icon" href="icon/icon.png" type="image/png">
<link rel="apple-touch-icon" href="icon/icon.png">
<link rel="stylesheet" type="text/css" href="fonts/gamefont.css">
<title>A NEW FANTASTIC TIME tale of middle galaxi</title>
</head>
<body style="background-color: black">
<script type="text/javascript" src="js/libs/******my new js"></script> // add you new lib here
<script type="text/javascript" src="js/libs/pixi.js"></script>
<script type="text/javascript" src="js/libs/pixi-tilemap.js"></script>
<script type="text/javascript" src="js/libs/pixi-picture.js"></script>
<script type="text/javascript" src="js/libs/fpsmeter.js"></script>
<script type="text/javascript" src="js/libs/lz-string.js"></script>
<script type="text/javascript" src="js/rpg_core.js"></script>
<script type="text/javascript" src="js/rpg_managers.js"></script>
<script type="text/javascript" src="js/rpg_objects.js"></script>
<script type="text/javascript" src="js/rpg_scenes.js"></script>
<script type="text/javascript" src="js/rpg_sprites.js"></script>
<script type="text/javascript" src="js/rpg_windows.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</body>
</html>
The above will work fine and the plugin should be available in game as stated on the npm page. But, just be careful, since it does use node, and any project that's using node shouldn't technically work in the browser.
Unfortunately, the plugin doesn't load, even with @Jonforum's suggestion. My programmer can't get it to load at all 🙁
Strange; I ran a custom library for live2D in RMMV. I could take a look and see if I can make it work. Is this game only for embedded systems or is it for browser too? @Celianna
It's not meant for a browser, so there's no issues there. As long as it can run on a blank MV project, my programmer can get it to work on mine.

Interesting you got Live2D to work in MV! Nice to hear that's possible 🙂
Unfortunately, the plugin doesn't load, even with @Jonforum's suggestion. My programmer can't get it to load at all 🙁
Have you try to load it in a different order, because the orde has an importance.
If your library conflicts with another it will be overwritten
These in the same principle as creating a website, some librayry have to be loaded before in the header and other in the footer to avoid conflated between librairy JS.

Otherwise I do not see why it is not loading.
@Jonforum he's tried just about everything but he can't seem to get it to load at all. Do you think you can try it yourself and load it on a blank MV project? See if that works?
@Jonforum he's tried just about everything but he can't seem to get it to load at all. Do you think you can try it yourself and load it on a blank MV project? See if that works?

it load in the html but give after error !
Uncaught ReferenceError: module is not defined
I guess you have to follow the complete installation guide here.
https://www.npmjs.com/package/pngjs#installation

Your programmer can take a closer look at how the module is installed
with ref of pixi-picture.js , lz-string.js, pixi.js

But it sounds hyper complex, and very far from my ability.
Code:
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.PIXI = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var EMPTY_ARRAY_BUFFER = new ArrayBuffer(0);
@Celianna I got the module to work and you can access it under the name PNG, like mentioned on the npm page; had to bundle it with browserify since it was so many different files, and didn't want to use webpack.

You'll need these two files:
Place the lib-png.js in the RMMV js/libs folder for your project, and activate the plugin in the PluginManager.
Hope this helps with your project.

Also, this is a good blog post detailing how browserify bundles a standalone: Browserify
@Kino thanks a lot for that, it works!
@Celianna Awesome; glad I could help. Lol for a moment there, I was wondering if it would work on your end or not.
Good that the problem is solved that way, but wouldn't it be better/faster to fix this loss of transparency issue?
It shouldn't happen in the first place.
Ah yes, the transparency issue was after all, not something that was solved with this custom library. My programmer found the issue, and knows the solution (something about the snapshot he was taking was causing the issue, but he doesn't know how to copy a mask onto bitmap any other way). But that's a different issue!

Original thread: https://forums.rpgmakerweb.com/threads/anyway-to-load-a-custom-library-in-mv.78457/