Skip to content

Instantly share code, notes, and snippets.

@3l3gant-cod3s
3l3gant-cod3s / data-uri.py
Last active August 21, 2022 07:10 — forked from jsocol/data-uri.py
Give an image, get a data-uri
#!/usr/bin/python3
"""Command line script to convert a file, usually an image, into a data URI
for use in CSS (no return every 76 chars) """
import base64
import mimetypes
import os
import sys