A simple command-line meme generator written in Go. This is my first project learning Go. It fetches an image from a URL, overlays text on it, and saves the result as out.png
.
- Fetches images from a URL.
- Adds text to the image with a semi-transparent background.
- Outputs a new meme image.
Make sure you have Go installed. If not, download and install it from Go's official website.
git clone https://github.com/AvyuktBallari/MemeGenerator.git
cd MemeGenerator
go mod init MemeGenerator
go get github.com/fogleman/gg
Create a Fonts
directory and add an Arial.ttf
font file:
mkdir Fonts
wget -O Fonts/Arial.ttf https://github.com/google/fonts/blob/main/apache/arial/Arial.ttf?raw=true
go build -o meme
./meme meme --link="https://example.com/image.jpg" --text="Hello World"
or without compiling:
go run main.go meme --link="https://example.com/image.jpg" --text="Hello World"
- Input:
--link=https://example.com/image.jpg --text="Hello World"
- Output:
out.png
(saved in the project directory)
- URL Could not be accessed!: Ensure the image URL is correct and accessible.
- Could not copy the image!: Check your network connection.
- panic: open ./Fonts/Arial.ttf: no such file or directory: Ensure the font file exists in the
Fonts/
directory. - Command not found: Ensure the binary is executable (
chmod +x meme
on macOS/Linux).
This project is open-source and available under the MIT License.
Created by Avyukt Ballari. Contributions welcome!