📄 Full changelog → CHANGELOG.md A Python-based tool that transforms poems into abstract art using natural language processing and simple machine learning. Choose from multiple artistic styles to match your poem's mood!
- Analyzes the mood and tone of the poem using NLP and sentiment analysis
- Extracts keywords and emotional themes
- NEW: Choose from 5 artistic styles - Vibrant, Minimalist, Ethereal, Bold, or Organic
- Generates visual elements and color palettes to match the poem and selected style
- Uses Unsplash API to add backgrounds (optional)
- Creates abstract artwork using pygame, saves it as a .png image
- Detects emotions using TextBlob or VADER
- Extracts key themes using nltk
- Matches emotion to color palettes
- Places visual elements (shapes, patterns, swirls) based on poem keywords
- Vibrant: Bold colors, high contrast, energetic feel
- Minimalist: Clean, simple shapes with limited color palette
- Ethereal: Soft, dreamy with transparent layers and flowing shapes
- Bold: High contrast, geometric shapes, strong visual impact
- Organic: Natural, flowing shapes with earth-inspired colors
- Auto-select: Automatically picks the best style based on poem emotion
- Generates original, soft, vibrant, and vintage art variants
- Complete background image management with download and caching
- Integration with Unsplash API for nature backgrounds (sky, forest, ocean, mountains, sunset)
- Style-specific particle effects and visual elements
- Dynamic element count and sizing based on selected style
- Runs completely locally
- Clone the repository:
git clone https://github.com/kayvour/paintmypoem.git
cd paintmypoem- Install dependencies:
pip install -r requirements.txt- Run the script:
python main.py- Choose your experience:
- Select interactive mode for full features
- Use demo mode with sample poems
- Choose from 5 artistic styles or let the AI auto-select
- Add backgrounds or use gradient-only mode
- Poem Analysis: Sentiment analysis determines emotional tone (joy, sadness, anger, etc.)
- Keyword Extraction: Key themes and visual words are identified (stars, rain, fire, etc.)
- 🎨 Style Selection: Choose your preferred artistic style or let AI auto-select
- Visual Planning: Shapes, positions, and colors are mapped based on emotion, keywords, and style
- Background Selection: Optional nature backgrounds from Unsplash API
- Art Generation: Final artwork created using pygame with style-specific effects
- Minimalist + Sad Poem = Clean circles, muted blues, few elements
- Vibrant + Joyful Poem = Bold stars, bright yellows/oranges, many elements
- Ethereal + Love Poem = Soft circles, transparent pinks, flowing particles
- Bold + Angry Poem = Sharp triangles, high contrast reds, thick borders
- Organic + Nature Poem = Flowing shapes, earth tones, atmospheric effects
- Python 3
- Natural Language Toolkit (nltk)
- TextBlob / VADER Sentiment Analysis
- pygame for art generation
- Unsplash API for background images
- Custom Style Presets System
- Works best with short to medium poems (4-12 lines)
- Poetic imagery and emotion words improve output quality
- Each style produces distinctly different visual results
- Background images enhance the final artwork but are optional
- The sample poems in the /sample poems folder were generated using ChatGPT for demonstration
- ✅ Add style presets
- More detailed shape variations (fractals, splines, organic forms)
- GUI version for drag-and-drop poem uploads
- Custom style creator for advanced users
- Integration with more background sources
- Create an executable release (.exe) so users can run without installing Python
- Optimize and test for longer poems with chunking/batching
- Advanced sentiment analysis with transformer models
- Animation mode for moving visualizations
- Social media sharing integration
Contributions are welcome! If you have suggestions, improvements, or bug fixes:
- Fork the repository
- Create a feature branch
- Submit a pull request
For major changes, please open an issue to discuss first.
- New artistic styles in styles.py
- Additional shape types in art_generator.py
- Enhanced keyword extraction patterns
- New background sources or generation methods
This project is licensed under the MIT License. See the LICENSE file for details.
PaintMyPoem celebrates the union of poetry and code. Whether you're a writer exploring visual expression or a coder fascinated by creative applications, this project helps bring verse to life through generative art! 🎨✨