Created
June 14, 2023 16:21
-
-
Save mustafaboleken/38e89ed0d00520da5dcb3388e10de9c6 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 sys | |
import PIL.Image as Image | |
import pathlib | |
width = int(sys.argv[1]) | |
height = int(sys.argv[2]) | |
output_name = sys.argv[3] | |
frame_data = sys.stdin.buffer.read() | |
pathlib.Path('/usr/local/antmedia/image').mkdir(parents=True, exist_ok=True) | |
img = Image.frombuffer("RGBA", (width, height), frame_data, "raw", "RGBA", 0, 1) | |
img.save(f"/usr/local/antmedia/image/{output_name}.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment