Generate stylized typography SVGs and PNGs with gradient colors, emoji patterns, and animated text. I run this on a CF worker but you can run on either Browser or Node.
npm install hypeimageimport { generateImage, generateAnimatedText, generateImagePNG } from 'hypeimage';
// Generate SVG string
const svg = generateImage({ text: 'hello' });
// Generate animated SVG string (open in browser to see the animation)
const animSvg = generateAnimatedText({ text: 'hype', style: 'soft', speed: 3, loop: true });
// Generate PNG buffer (requires @resvg/resvg-js)
const png = await generateImagePNG({ text: 'hello', gradient: 'sunset' });Try these live β each URL renders directly in your browser:
| Style | URL |
|---|---|
| Crochet β hype with fire & art | /image?text=hype&style=crochet&emoji=π₯,π¨&emoji-opacity=0.3 |
| Soft β wavy with sunset & sparkles | /image?text=wavy&gradient=sunset&style=soft&emoji=β¨,π«&emoji-opacity=0.4 |
| Yarn β knit with purpledream & stars | /image?text=knit&gradient=purpledream&style=yarn&emoji=β,π&emoji-opacity=0.3 |
| Outlined β wave with beach & ocean | /image?text=wave&gradient=beach&style=outlined&emoji=π,π&emoji-opacity=0.35 |
| Crochet dark β dark with gems | /image?text=dark&gradient=purpledream&bg=%231a1a2e&style=crochet&emoji=π,β¨&emoji-opacity=0.5 |
Returns an SVG string.
Returns an SVG string with CSS keyframe animations. Set speed and loop to control the animation. Works anywhere β the CSS animations play when the SVG is rendered in a browser.
Returns a PNG buffer. Requires @resvg/resvg-js as a peer dependency.
npm install @resvg/resvg-js| Option | Type | Default | Description |
|---|---|---|---|
text |
string |
(required) | Text to render (max 10 chars, alphanumeric) |
gradient |
string |
"valkyrie" |
Color scheme: valkyrie, sunset, purpledream, beach |
bg |
string |
"#FFF9C4" |
Background hex color |
style |
string |
"outlined" |
Render style: outlined, soft, crochet, yarn |
emoji |
string[] |
[] |
Background emoji pattern (max 4) |
emojiAngle |
number |
45 |
Emoji rotation in degrees |
emojiOpacity |
number |
0.5 |
Emoji opacity 0-1 |
paddingLeft |
number |
0 |
Horizontal padding in px |
paddingTop |
number |
0 |
Vertical padding in px |
speed |
number |
1 |
Animation speed multiplier (animated only) |
loop |
boolean |
false |
Loop the animation (animated only) |
Returns the list of available gradient names.
const svg = generateImage({ text: 'Hello' });const svg = generateImage({ text: 'World', gradient: 'sunset' });const svg = generateImage({
text: 'hype',
gradient: 'sunset',
bg: '#FFF9C4',
style: 'crochet',
emoji: ['π₯', 'π¨', 'π»', 'π»'],
emojiAngle: 45,
emojiOpacity: 0.25,
});const svg = generateImage({ text: 'Soft', style: 'soft' });const svg = generateImage({ text: 'Knit', style: 'yarn' });const svg = generateAnimatedText({
text: 'hype',
style: 'crochet',
speed: 3,
loop: true,
emoji: ['π₯', 'β¨', 'π¨', 'π'],
emojiOpacity: 0.25,
});
document.getElementById('out').innerHTML = svg;const svg = generateImage({
text: 'Hey',
bg: '#333',
emoji: ['β¨'],
emojiOpacity: 0.5,
});const svg = generateImage({
text: 'Flat',
emoji: ['π'],
emojiAngle: 0,
});const png = await generateImagePNG({
text: 'party',
gradient: 'purpledream',
style: 'crochet',
emoji: ['π₯', 'β¨', 'π'],
});