https://github.com/josepmedialdea/backdrop
๐ผ๏ธ CLI tool that fills transparent image backgrounds with a solid color. Supports local files, URLs, and emoji input.
https://github.com/josepmedialdea/backdrop
cli emoji go golang image-processing transparency
Last synced: 3 months ago
JSON representation
๐ผ๏ธ CLI tool that fills transparent image backgrounds with a solid color. Supports local files, URLs, and emoji input.
- Host: GitHub
- URL: https://github.com/josepmedialdea/backdrop
- Owner: josepmedialdea
- License: mit
- Created: 2026-03-18T17:27:39.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-23T22:16:00.000Z (3 months ago)
- Last Synced: 2026-03-24T21:03:10.565Z (3 months ago)
- Topics: cli, emoji, go, golang, image-processing, transparency
- Language: Go
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
backdrop
CLI tool that fills transparent image backgrounds with a solid color.
Features
ยท
Installation
ยท
Usage
ยท
Examples
## About
backdrop takes an image with a transparent background โ a local file, URL, or emoji โ and fills it with a solid color.
I built this to generate consistent project avatars for GitLab, but it works anywhere you need a quick, polished image with a colored background โ favicons, social cards, README badges, etc.
## Features
- **Multiple input sources** โ local files, HTTP(S) URLs, or emoji (e.g. `๐ `)
- **Flexible color input** โ hex (`#FF5733`) or RGB (`255,87,51`)
- **Square mode** โ force output to a perfect square
- **Padding** โ add breathing room in pixels (`--padding 20`) or as a percentage of the image (`--padding 10%`)
## Installation
### Homebrew
```sh
brew install josepmedialdea/tap/backdrop
```
### From source
```sh
git clone https://github.com/josepmedialdea/backdrop.git
cd backdrop
make build
# binary is at ./bin/backdrop
```
### Go install
```sh
go install github.com/josepmedialdea/backdrop/cmd/backdrop@latest
```
## Usage
```
backdrop [flags]
```
### Flags
| Flag | Short | Default | Description |
|------|-------|---------|-------------|
| `--color` | `-c` | `#000000` | Background color as hex (`#rrggbb`) or `R,G,B` |
| `--output` | `-o` | auto | Output file path (default: `_bg.`) |
| `--force` | | `false` | Overwrite output file if it already exists |
| `--square` | | `false` | Make output image a perfect square |
| `--padding` | | `0` | Padding on all sides: pixels (e.g. `20`) or percentage (e.g. `10%`) |
## Examples
```sh
# Fill a local PNG with a blue background
backdrop logo.png -c "#3498db"
# Fetch an image from a URL and apply a red background
backdrop https://example.com/icon.png -c 255,0,0
# Render an emoji with a dark background
backdrop ๐ฆ -c "#1a1a2e"
# Square output with 10% padding
backdrop logo.png -c "#2ecc71" --square --padding 10%
# Explicit output path, overwrite if exists
backdrop logo.png -c "#000000" -o result.png --force
```
## License
[MIT](LICENSE)