MZ Export PNG from Composite Bitmap Pictures

Hi, I'm looking for a way to combine multiple picture files and then save that composite out as a PNG file. I know a little bit of JavaScript, but I've never made my own plugin before.

I'm working on a project where I'm creating card images that will populate with icons overlaid on top of the image based on variables/Actor Database items (type, traits, name, etc.). I made a rough mockup in p5.js here, but I'm looking to recreate this in RPG Maker so I can use the Database and features of RPG Maker to better automate what I'm going for.

I found the KC_CompositeBitmaps plugin which is very close to what I'm looking for, but there are a few features missing that won't quite work with my project. I'd like to be able to choose the X/Y position of individual picture files and also be able to reference elements from the Actor Database for file names (as that's where I'm storing all of the individual traits/information for all of the cards).

My ideal solution would be a way to show the pictures on the screen (where I can control which pictures with Database/variables and their X/Y positions), and then export all of the pictures that are currently shown as a single PNG (with no quality loss).

There might be an easier way to achieve this without a plugin as well, but I'm not sure how to approach it. Does anyone have any ideas on how to go about this?
Sorry if this isn't as direct of an answer as you're looking for, but the Orange Mapshot plugin essentially assembles a composite bitmap and exports it as a png, so maybe if you take a look at its code, you'll be able to get an idea of how to move forward with your own plugin.
Sorry if this isn't as direct of an answer as you're looking for, but the Orange Mapshot plugin essentially assembles a composite bitmap and exports it as a png, so maybe if you take a look at its code, you'll be able to get an idea of how to move forward with your own plugin.

Thanks for sending this plugin! I originally found the MV one when I was researching but didn't realize you updated it for MZ! I'll take a look at the code. But right now when I save a screenshot out using it, it doesn't save the pictures that are shown on the screen, it only saves the tiles. But this'll be good to poke around in and see what I can find, thanks.
No problem. Unfortunately, showing pictures wouldn't really be practical for this plugin, because pictures are positioned relative to the current screen, rather than to the map itself.

But the reason I recommended it is because the plugin works by creating a large bitmap, and then it draws each tile (smaller bitmaps) onto the big bitmap at specific locations, in a layered manner, and then it exports that big bitmap as a png. Setting aside the specifics and the scale, it's fundamentally what you're trying to do (to my understanding), so I figured that maybe the code would give you some hints.

Original thread: https://forums.rpgmakerweb.com/threads/export-png-from-composite-bitmap-pictures.164018/