You give it HTML and it gives back an image!

Fast, lightweight rendering - no browser, no fuss

Stand out with dynamic image previews

CLI
Ruby
Rails
# Install the gem
gem install himg

# Generate from a file
himg screenshot path/to/your.html screenshot.png

# Or from a URL
himg screenshot https://himg.jamedjo.co.uk himg.png --width=1024
require 'himg'

# Generate an image from HTML
png = Himg.render("<h1>Hello Image</h1>")
File.open("output.png", "wb") { |f| f.write(png) }

# With options
png = Himg.render(html, width: 720, height: 405)
# Create app/views/users/show.himg.erb
<div><%= @user.name %></div>

# Optional: Configure in your controller
himg_config(width: 720, height: 405, disable_fetch: false)

# That's it! Access at users/123.png

No Browser Required

Pure HTML/CSS parsing with Rust. No 2GB Chrome process, no Bluetooth APIs, no MIDI keyboards.

🏗️

Zero Infrastructure

No background jobs, no Redis queues, no external services. Storage and caching optional.

💎

Rails Ready

Drop in a `.himg.erb` template and you're done. Use template variables to create dynamic images for each user, post, or product.

Turn boring links into rich visual previews

❌ Without OpenGraph
💬 Potential customer
https://store.example.com/products/awesome-widget-2024
✅ With OpenGraph (using himg)
💬 Potential customer
https://store.example.com/products/awesome-widget-2024

Every time someone shares your link, you have one chance to make an impression.

Create dynamic previews tailored to each page. Show actual prices, user profiles, product images - whatever makes your content compelling. Not just another generic placeholder.

2.3x
more engagement
on Facebook
4x
more shares
on Twitter
8x
more clicks
on SMS

Add rich previews in 2 simple steps

# Step 1: Create app/views/users/show.himg.erb
<div><%= @user.name %></div>

# Step 2: Add OpenGraph meta tags to your HTML
<meta property="og:title" content="<%= @user.username %>" />
<meta property="og:description" content="<%= @user.tagline %>" />
<meta property="og:image" content="<%= user_url(@user.username, format: :png) %>" />

Ready to Generate Images from HTML?

Check out the full documentation and contribute on GitHub