Created
November 28, 2022 00:14
-
-
Save zhuowei/5aaa7d475606e7a3bf156c63416d2396 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import png | |
import sys | |
with open(sys.argv[1], "rb") as infile: | |
chunks = list(png.Reader(file=infile).chunks()) | |
chunks.insert(1, (b"cICP", bytes([9, 16, 0, 1]))) | |
with open(sys.argv[2], "wb") as outfile: | |
png.write_chunks(outfile, chunks) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment