Save levels inside of a png

If the question is regarding screenshots, it appears it has been answered before.

You can render a Viewport/SubViewport to a ViewportTexture, and then save the contents of the ViewportTexture as follows using Texture2D.get_image():

var viewport_texture = $"path/to/your/viewport/texture"

func save_screenshot() -> Error:
    return viewport_texture.get_image().save_png("path/to/your/output.png")

Please note I have not personally tested the above code, but it should be roughly correct. In the case of any doubt, please refer to the linked documentation.

If you need to perform some operation, say the steganographic technique discussed before, you can use Image.save_png_to_buffer() instead, and then operate directly on the created buffer.