Since we already use libpng for image patching and sprite boundary dumping, this could very easily be done without requiring any game-specific code by detouring the Windows file APIs. One caveat, though:
(21:00:53) linkmauve1: Warning about that, PNG is very slow to encode.
(21:01:24) linkmauve1: If possible store the raw image data in a buffer and pass it to an encoding thread.
Since we already use libpng for image patching and sprite boundary dumping, this could very easily be done without requiring any game-specific code by detouring the Windows file APIs. One caveat, though: