Skip to content

Instantly share code, notes, and snippets.

@gsanchezd
Created October 7, 2022 18:48
Show Gist options
  • Save gsanchezd/df62e3c369e549b7d1dfca158c7c6366 to your computer and use it in GitHub Desktop.
Save gsanchezd/df62e3c369e549b7d1dfca158c7c6366 to your computer and use it in GitHub Desktop.
remove_backgrounds
#!/usr/bin/python
# -*- coding: utf-8 -*-
from rembg import remove
from PIL import Image
import sys
def main():
input_path = sys.argv[1]
output_path = sys.argv[2]
input = Image.open(input_path)
output = remove(input)
output.save(output_path)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment