Xtool | -mpng+reflate

# Replace stream index 2 with new compressed data xtool mpng-reflate original.png patched.png --replace 2:new_stream.zlib

xtool mpng-reflate input.png [output.png] [--recompress-level 1-9] [--extract-only] [--replace DATA] xtool -mpng+reflate

streams = extract_mpng_streams(input_png) if not streams: print("No MPNG chunks found.") return # Replace stream index 2 with new compressed