Heroimg is an image generator that transforms words into stunning visuals. You can use it to create images for your social media posts, blog posts, or any other purpose.
Warning
The project is still in early development, and the results of different versions may vary significantly.
The API can be accessed via https://heroimg.glitch.me/
.
Heroimg currently has only one API endpoint available, you should use the GET method to access it:
Method | URL | Description |
---|---|---|
GET |
/hero | Generate an image with text on it |
GET |
/hero-experimental | Generate an image with text on it (experimental functions enabled) |
The following parameters are available for the API:
Parameter | Type | Description | Options | Default |
---|---|---|---|---|
title |
string | Headline text to be displayed on the image |
/ | NEED A TITLE |
subtitle |
string | Subtitle or copyright text to be displayed on the image |
/ | / |
style |
string | Style of the image background | blob wave blurry-gradient blob-scene layered-waves layered-peaks |
Randomly choose one |
shape |
string | Shape of the image | 16:9 4:3 1:1 |
16:9 |
fontSize |
number | Font size of the headline text | / | 96 |
subFontSize |
number | Font size of the subtitle text | / | fontSize / 2 |
fontColor |
string | Color of the text | / | #ffffff |
The API returns an image with the specified text on it. The image is in PNG format.
If the parameters are invalid, the API returns a 400 Bad Request
response and gives detailed reasons. If the image cannot be generated, the API returns a 500 Internal Server Error
response.
blob |
wave |
blurry-gradient |
---|---|---|
blob-scene |
layered-waves |
layered-peaks |
16:9 |
4:3 |
1:1 |
---|---|---|
This is a Node.js project. To host it yourself, you only need to clone this repository and run the following commands:
npm install
npm run start
It also supports hot-reloading with nodemon
:
npm run dev
You can also deploy this project to Glitch by clicking the following button:
The project is hosted on Glitch.