Component-based, themeable graphics generation from JSON config. Professional LinkedIn posts, event posters, marketing materials.
- Theme Presets:
dark_theme()andlinkedin_theme()for instant professional styling - Dot Grid Pattern: Alternative to line grids for modern aesthetics
- Background SVG: Add silhouettes and background shapes
- Event Poster Components: Stacked metrics, positioned logos, subtitles
- Security: HTML escaping for XSS prevention
- LinkedIn Templates: Quote, stats, tips, announcements, comparisons
badge: Top badge/label with optional iconheadline: Large headline text with bold/muted partsquote_card: Testimonial/quote card with authormetric_card: Statistics/metric display with change indicatorcta_card: Call-to-action card with buttoninfographic_card: Numbered process/steps displaylogo_card: Dual-brand footer
process_flow: Connected steps with arrows (horizontal/vertical)bar_chart: Data visualization barstimeline: Event timeline with iconscomparison: Before/After side-by-sidefeature_grid: Icon + text grid layouts (2-4 columns)stats_dashboard: Multi-metric cards with trendsprogress_bar: Progress indicators
event_poster: Stacked metric lines (3 months / 40 founders / 100k EUR)subtitle: Event details with highlighted textpositioned_logo: Logo in any cornerbackground_svg: Background silhouettes
pip install -r requirements.txt
playwright install chromium # For PNG conversionfrom openfigma import GraphicsBuilder, linkedin_theme
builder = GraphicsBuilder(linkedin_theme())
config = {
"components": [
{"type": "badge", "content": {"text": "Career Tips"}},
{"type": "headline", "content": {
"text": "5 habits of highly effective leaders",
"size": "large",
"align": "center"
}},
{"type": "infographic_card", "content": {
"title": "",
"items": [
"They prioritize deep work",
"They give feedback in real-time",
"They hire people smarter than themselves"
]
}}
]
}
html = builder.build_from_config(config, dimensions=(1080, 1080))from openfigma import GraphicsBuilder, dark_theme
theme = dark_theme()
theme.grid_enabled = True # Cyan dot grid
builder = GraphicsBuilder(theme)
config = {
"components": [
{"type": "event_poster", "content": {
"lines": [
{"number": "3", "text": "months", "size": "140px"},
{"number": "40", "text": "founders", "size": "140px"},
{"number": "100k", "text": "EUR", "size": "140px"},
]
}},
{"type": "subtitle", "content": {
"text": "16th February - STATION F Paris, FR",
"highlight": "STATION F"
}},
{"type": "positioned_logo", "content": {
"text": "pioneers",
"position": "bottom-right"
}}
]
}
html = builder.build_from_config(config)from openfigma import linkedin_theme
# Default LinkedIn blue
theme = linkedin_theme()
# Custom accent colors
theme = linkedin_theme("#10b981") # Green
theme = linkedin_theme("#8b5cf6") # Purple
theme = linkedin_theme("#f59e0b") # Orangefrom openfigma import dark_theme
theme = dark_theme()
theme.grid_enabled = True # Cyan dot grid
theme.grid_size = "25px" # Grid spacing
theme.accent = "#22d3ee" # Cyan accentTheme(
# Colors
background="#ffffff",
surface="#f8fafc",
text_primary="#0f172a",
text_secondary="#475569",
accent="#0077b5",
# Fonts
font_family="'Inter', sans-serif",
font_headline="800",
# Grid
grid_enabled=False,
grid_style="dots", # "dots" or "lines"
grid_color="rgba(0,0,0,0.1)",
grid_size="20px",
# Background
background_svg=None, # SVG content for silhouettes
)See examples/ folder:
linkedin_posts.py- 6 LinkedIn post templateslinkedin_carousel.py- Carousel slides, hiring posts, poll resultsevent_poster.py- Dark event poster with city skyline
All user content is HTML-escaped to prevent XSS attacks. Input validation is applied to CSS class names and positions.
- LinkedIn posts and carousels
- Event/conference posters
- Quote graphics
- Statistics highlights
- Job posting graphics
- Achievement announcements
- Before/after comparisons
- Process diagrams
MIT - Use freely for your own projects.
v2.2.0 - LinkedIn templates, dark theme, security hardening