I have a hard time understanding this question.
Heres the thing, png files are loaded into memory.
So lets say you have 2 png files, each of these files will occupy a its own region in the memory.
Loading of png into memory usually involves several steps as its a compressed file format.
Reading the data, decoding it, creating a in memory representations of the file etc.
"There is a reason people use 3rd party libs

"
The actual compositing process happens either on the cpu or the gpu.
These days its mostly done on the gpu by using opengl, directx etc.
The composite image is then transferred to the framebuffer on the video card to be displayed.
If the compositing was done on the gpu. its directly transferred into the framebuffer, ie by shaders etc.
Can you grab that image from the framenbuffer, absolutely.
This will be the hardest part tho as you need to dive into the api of advance frameworks.
This method is a bit hackish and requires a bit understanding how the hole video pipeline works.
you can probably find tools for this already.
creating base64 encoding isnt hard. you will spend 2min with chatgpt and he will make you some code.
or spend 1h and make one yourself if you know how it works.. there is also a ton of online encoders.
I and not a renpy developer. but there must be some functions inside renpy that creates overlays/handles images etc.
If you can trace back that function(s) you can modify them and do whatever you want with the data.
I have no idea what you mean by API transmission.
An api is not something you transmit. its just a set of rules for building and interacting with different programs.
It just defines how how you do the "communication". regarding protocol, data structures etc etc.
base64 can be send over the network fine.
However. i do not like that. if you plan on sending the png over the network leave it raw.
as base64 increases the size of the data transfer.
Encoded Size (bytes) = ((Input Size (bytes) /3 ) × 4 + (Padding Bytes)
So a 100KB image becomes 133.33KB
((100/3)*4) +0 = 133KB. 33% more data to transfere.
However if you're trying to embed the png into a webpage or something then thats another story.
* background-image: url(data:image/png;base64,iVBORw0KGgoAA......)
* const B64_Image_touch = "data:image/png;base64,iVBORw0KGgoAA....)
...
So Is it possible to do it? , Yes ofc it is, is it worth the effort, that's another story and be your thing to decide.