Skip to content

Instantly share code, notes, and snippets.

@zlove
zlove / image64.sh
Last active September 27, 2017 00:16 — forked from kamikat/image64.sh
Create data URI image from Terminal command
#! /usr/bin/env bash
# Examples:
# ./image64.sh myImage.png
# outputs: data:image/png;base64,xxxxx
# ./image64.sh myImage.png -img
# outputs: <img src="data:image/png;base64,xxxxx">
function usage {
echo "usage: $0 <image_filename> [--img]"