A Python package to generate iridescent backgrounds with random colored lines and Gaussian blur.
Project description
Iridescent-BG: Vibrant Background Generator
Overview
The iridescent-bg Python package generates stunning iridescent backgrounds for images, characterized by a shimmering, rainbow-like effect. Using random colored lines in the HSV color space with a Gaussian blur, it creates visually striking backgrounds suitable for digital art, presentations, social media graphics, or any project needing a vibrant backdrop. Users can optionally add text and images with customizable positions.
Features
- Iridescent Effect: Creates a shimmering background using 75 random lines with vibrant hues, blended with a 20-pixel Gaussian blur.
- Customizable Parameters: Adjust line count, opacity, blur, base color, and enhance vibrancy.
- Flexible Output: Generates backgrounds of any size with 600 DPI support.
- Optional Text Overlay: Add centered top text or custom-positioned text.
- Optional Image Overlay: Add user-provided images with customizable size and position.
- Lightweight: Built with Pillow and NumPy.
- Applications: Ideal for digital art, social media, presentations, websites, and more.
Requirements
- Python Libraries: Pillow, NumPy.
- Python Version: 3.6 or higher.
Installation
- Ensure Python 3.6+ is installed.
- Install via pip: pip install iridescent-bg
- Verify: python -c "import iridescent_bg; print(iridescent_bg.version)"
Usage
Basic Background
Generate a black-based iridescent background: python from iridescent_bg import generate_iridescent_background from PIL import Image bg = generate_iridescent_background(width=1080, height=1080, enhance_vibrancy=True) bg.save("my_background.png", dpi=(600, 600))
Add Centered Top Text
python from iridescent_bg import generate_iridescent_background, add_text from PIL import Image bg = generate_iridescent_background(width=1080, height=1080, enhance_vibrancy=True) bg = add_text(bg, text="My Title", font_size=48, center_top=True) bg.save("my_text_background.png", dpi=(600, 600))
Add Custom Image
python from iridescent_bg import generate_iridescent_background, add_text, add_image from PIL import Image bg = generate_iridescent_background(width=1080, height=1080, enhance_vibrancy=True) bg = add_text(bg, text="My Project", font_size=48, center_top=True) bg = add_image(bg, side_image_path="path/to/your/image.jpg", width=540, position=(0, 0)) bg.save("my_image_background.png", dpi=(600, 600))
Configuration
- Default Settings: 1080×1080, black base, 75 lines, 100 opacity, 20 blur, 200 dash length.
- Customization: Adjust width, height, base_color (e.g., "#FF0000"), enhance_vibrancy, text position, image size/position.
Example Outputs
See generated examples in the repository.
Testing
Run unit tests: python -m unittest discover tests
Notes
- The iridescent effect uses HSV for vibrant hues, varying each run.
- Ensure dependencies are installed.
- Customize base_color, text, and images as needed.
License
MIT License. Free to use, modify, and distribute.
Author
Developed by Charleen Adams. Contributions welcome at https://github.com/adams-charleen/iridescent-bg.
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 iridescent_bg-0.1.0.tar.gz.
File metadata
- Download URL: iridescent_bg-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45b94f1e5de7d0d2d9336d5dad1b8c0529ac388b3d88ee9e83d4427a4a83cdee
|
|
| MD5 |
69c613cf36a7ca6865fc394accd2f64c
|
|
| BLAKE2b-256 |
588eea7a809a55deb8fae8a0a9636852969619e73c18825827205437d9d4c05e
|
File details
Details for the file iridescent_bg-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iridescent_bg-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6433309a93105723124e90c0a3f1a788373229f90bed3c67253153c1c267759b
|
|
| MD5 |
e0179021d1706d30089298edc6b32fc8
|
|
| BLAKE2b-256 |
76b304fadd1f4242569679d089148109cb16f8ccd8b02199d5c06c1d2e7157f3
|