Generate customizable icons from Iconify with easy export to PNG, SVG, WebP
Project description
icon-gen-ai
Generate customizable icons from Iconify, direct URLs, or local files with easy export to PNG, SVG, WebP formats.
Features
- AI-assisted icon search and generation
- Simple and intuitive CLI and Python API
- Access 200,000+ icons from Iconify
- Unlimited icons from direct URLs or local files
- Customize colors, sizes, and backgrounds and adjust border radius
- Gradient color option for icons and backgrounds
- Export to SVG, PNG, or WEBP format
Installation
pip install icon-gen-ai
(Optional) AI features:
pip install icon-gen-ai[ai]
Quick Start
Generate Single Icons
from icon_gen import IconGenerator
generator = IconGenerator(output_dir="output")
# From URL (white icon, purple background)
generator.generate_icon(
direct_url='https://upload.wikimedia.org/wikipedia/commons/b/b0/Claude_AI_symbol.svg',
output_name='claude_white_purple_bg',
color='white',
bg_color='#8B76E9',
border_radius=0,
size=256
)
# From Iconify (white icon, pink background, circle)
generator.generate_icon(
icon_name='simple-icons:googlegemini',
output_name='gemini_white_pink_bg',
color='white',
bg_color='#EA2081',
border_radius=128, # Circle (half of size)
size=256
)
# From Iconify (white icon, gradient background, rounded)
generator.generate_icon(
icon_name='simple-icons:mistralai',
output_name='mistral_white_gradient_bg',
color='white',
bg_color=('#8B76E9', '#EA2081'), # Gradient
border_radius=40,
size=256
)
# From Iconify (gradient icon, transparent background)
generator.generate_icon(
icon_name='simple-icons:openai',
output_name='openai_gradient_transparent_bg',
color=('#8B76E9', '#EA2081'), # Gradient icon
bg_color=None,
size=256
)
Generate Multiple Icons (Batch)
from icon_gen import IconGenerator
generator = IconGenerator(output_dir="output")
# Generate multiple icons at once
ai_icons = {
'llama_pink': 'simple-icons:meta',
'deepseek_pink': {
'local_file': 'input/deepseek-icon.png'
},
'nemotron_pink': {
'url': 'https://companieslogo.com/img/orig/NVDA-df4c2377.svg'
},
'grok_pink': {
'url': 'https://unpkg.com/@lobehub/icons-static-svg@latest/icons/grok.svg'
}
}
generator.generate_batch(ai_icons, color='#EA2081', size=256)
Icon Sources
Three ways to get icons:
1. Iconify (200,000+ icons)
Browse at Iconify
Format: collection:icon-name
# Popular collections:
'simple-icons:openai' # Company logos
'mdi:github' # Material Design Icons
'fa6-solid:scale-balanced' # Font Awesome
'heroicons:scale' # HeroIcons
AI-powered search (requires pip install icon-gen-ai[ai]):
icon-gen-ai search "payment icons for checkout" --generate
2. Direct URL
Any public image URL (SVG, PNG):
direct_url='https://upload.wikimedia.org/wikipedia/commons/b/b0/Claude_AI_symbol.svg'
direct_url='https://companieslogo.com/img/orig/NVDA-df4c2377.svg'
3. Local File
SVG or PNG (with transparent background):
local_file='input/my-icon.svg'
local_file='input/my-icon.png'
Examples
Check out the examples/ directory for more use cases:
Basic Generation:
generate_ai_icons_singular.py- Generate icons one-by-one with custom backgrounds & gradientsgenerate_ai_icons_batch.py- Generate multiple AI model icons at once (batch mode)
AI-Powered Search (requires pip install icon-gen-ai[ai]):
ai_simple_usage.py- Search and generate icons using natural languageai_icon_search.py- Advanced search with custom styles and project context
Development
# Clone the repository
git clone https://github.com/yauheniya-ai/icon-gen-ai.git
cd icon-gen-ai
# Install all dependencies (including dev tools)
uv sync
uv sync --extra ai
# Run tests
uv run pytest --cov=src --cov-report=term-missing
License
MIT License - see LICENSE file for details
Author
Yauheniya Varabyova (yauheniya.ai@gmail.com)
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file icon_gen_ai-0.2.6.tar.gz.
File metadata
- Download URL: icon_gen_ai-0.2.6.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
596aff078f4cfe0ba6c2f1e22e0c8972c40b7528c85927a9d130446f1ebf4763
|
|
| MD5 |
f2b81d7f433a52e3cd036a433a8b14ff
|
|
| BLAKE2b-256 |
9773892cefe98bbc75f66680f5e427c90dd25ca77cd1f23867413c8a175b43e5
|
File details
Details for the file icon_gen_ai-0.2.6-py3-none-any.whl.
File metadata
- Download URL: icon_gen_ai-0.2.6-py3-none-any.whl
- Upload date:
- Size: 25.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64d77298d3a81d420a81250bc2736dfd7ce98bb3836842ebd55370c398680f51
|
|
| MD5 |
42be72f146e04ad65f425361ee619007
|
|
| BLAKE2b-256 |
3c1397146d7753f9468ee1cf06392d67b3a5b1a34129d99bf7e06b55fab843d5
|