Can you make the game write image files?

I know you can make it write .txt files by using a Ruby script, but can you make it write image files too? I'm trying to make a game where the puzzles have image hints, but the image hints are in the files instead of the game, if that makes any sense. It's kind of like Oneshot but instead of a wallpaper, it's just a file.
If you are fine with having a bitmap (bmp) file, you should be able to simply write the whole bitmap object into a file and name it .bmp. I didn't test this, but it should be theoretically possible. Any image file is just a text file with a certain encoding, it is always possible to write it.

I am not sure whether or not RGSS3 allows you to apply compression to the bitmap that you are trying to save, but, in case it does not, if the operation is just about saving an image on disk, you can even use ChunkyPNG, a library that allows you to apply png compression to images.

Original thread: https://forums.rpgmakerweb.com/threads/can-you-make-the-game-write-image-files.139734/