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 MemeGeneratorgo mod init MemeGenerator
go get github.com/fogleman/ggCreate 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=truego 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 memeon macOS/Linux).
This project is open-source and available under the MIT License.
Created by Avyukt Ballari. Contributions welcome!