{"id":50818760,"url":"https://github.com/corgi-in-tights/poster-generator","last_synced_at":"2026-06-13T12:02:46.953Z","repository":{"id":324649678,"uuid":"1097913133","full_name":"corgi-in-tights/poster-generator","owner":"corgi-in-tights","description":"A flexible Python library for building and rendering graphics with support for layers, custom objects, and YAML-based templates.","archived":false,"fork":false,"pushed_at":"2025-11-30T03:30:55.000Z","size":5854,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-01T12:50:08.971Z","etag":null,"topics":["python","rendering","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/corgi-in-tights.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-17T02:36:12.000Z","updated_at":"2025-11-30T03:26:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/corgi-in-tights/poster-generator","commit_stats":null,"previous_names":["corgi-in-tights/poster-generator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/corgi-in-tights/poster-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corgi-in-tights%2Fposter-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corgi-in-tights%2Fposter-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corgi-in-tights%2Fposter-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corgi-in-tights%2Fposter-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corgi-in-tights","download_url":"https://codeload.github.com/corgi-in-tights/poster-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corgi-in-tights%2Fposter-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34283391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-13T02:00:06.617Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","rendering","yaml"],"created_at":"2026-06-13T12:02:45.049Z","updated_at":"2026-06-13T12:02:46.907Z","avatar_url":"https://github.com/corgi-in-tights.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Poster Generator\n\nA flexible Python library for building and rendering posters/infomatics with focus on text templates and dynamic usage.\n\n![Poster Generator Banner](https://raw.githubusercontent.com/corgi-in-tights/poster-generator/main/docs/images/showcase.png)\n\n\n[![Python Version](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\n## Features\n\n\t•\t🧱 Element and layer system with blend settings leveraging Pillow\n\n\t•\t🗂️ Canvas element querying, grouping, deserialization and composites\n\n\t•\t📄 YAML/JSON template loaders with variable substitution for reusable layouts\n\n\t•\t🎯 'Canva' snapping-inspired relative positioning for quick template development\n\n\t•\t🔌 Extensible, format-agnostic registry for every inheritable class\n\n\t•\t🛠️ Function-driven operations (e.g., hue shifting, scaling, transforms)\n    \n\t•\t📣 Designed for automated poster and social media post generation\n\n⸻\n\n\n## Installation\n\n### Using Poetry (recommended)\n\n```bash\npoetry add poster-generator\n```\n\n### Using pip\n\n```bash\npip install poster-generator\n```\n\n### From source\n\n```bash\ngit clone https://github.com/corgi-in-tights/poster-generator.git\ncd poster-generator\npoetry install\n```\n\n## Requirements\n\n- Python \u003e= 3.13\n- Pillow \u003e= 12.0.0\n- PyYAML \u003e= 6.0.3\n\n\n## Quick Start\n\nCheck out the `examples/` directory for concrete examples and [TEMPLATES.md](https://github.com/corgi-in-tights/poster-generator/blob/main/TEMPLATES.md) for a reference on the in-built template format.\n\n\n## Reference\n\n### Elements\n\nElements are the basic pieces you use to build a poster.  \nThe library comes with a few ready-to-use ones:\n\n- **TextElement** (`text`) – Regular text with custom fonts, wrapping, alignment, and opacity.\n- **ImageElement** (`image`) – Shows an image from a file path and lets you resize it however you need.\n- **RectangleElement** (`rectangle`) – A simple box shape with size, corner radius, fill, and opacity options.\n- **EllipseElement** (`ellipse`) – Like a rectangle, but drawn as an oval/circle instead.\n\n\nTo learn how to register custom elements for templates, please see [TEMPLATES.md](https://github.com/corgi-in-tights/poster-generator/blob/main/TEMPLATES.md).\n\n\n```python\ncanvas = Canvas(width=500, height=500)\n\nimage = ImageElement(\n    image_path=\"image.png\",\n    width=500,\n    height=500\n)  # position defaults to (0, 0)\ncanvas.add_element(\"background\", image, layer=\"background\")\n\ntext = TextElement(\n    position=(100, 100),\n    text=\"Hello World\",\n    font_size=48,\n    color=\"#000000\",\n    font_family=\"Open Sans\"  # See FontManager.get_font_families() for a full list!\n)\ncanvas.add_element(\"my_text_id\", text, groups=\"titles\")\n\nimage = canvas.render()\nimage.show()\n```\n\n#### Layers\n\nLayers help organize elements and control rendering order:\n\n```python\ncanvas.add_element(\"bg\", background, layer=\"background\")\ncanvas.add_element(\"title\", text, layer=\"foreground\")\n```\n\n#### Groups\n\nGroups allow you to manage related elements:\n\n```python\ncanvas.add_element(\"title\", text, groups=[\"headers\", \"top-section\"])\ncanvas.add_element(\"subtitle\", subtitle, groups=[\"headers\", \"top-section\"])\n\n# Query elements by group\nheaders = canvas.get_elements(groups=\"headers\")\n```\n\n### Operations\n\nApply transformations to elements:\n\n```python\nfrom poster_generator.operations import apply_hue_shift, set_hue_from_hex\n\n# Hue shift\nelement.apply_operation(apply_hue_shift, degrees=45)\n```\n\nTo learn how to register custom operations for templates, please see [TEMPLATES.md](https://github.com/corgi-in-tights/poster-generator/blob/main/TEMPLATES.md).\n\n### Element Queries\n\nQuery elements by identifier, group, or layer:\n\n```python\n# Get specific elements\nelements = canvas.get_first_element(identifier=\"my_subtitle\")\n\n# Combine filters (requires all to match by default)\nspecific = canvas.get_elements(\n    groups=\"images\",\n    layers=\"background\",\n    # require_all=True,\n)\n```\n\nThere are a few other methods, mostly to do with drawing, removing elements, cropping, etc. I recommend taking a look to see if any are useful to you :)\n\n## Contributing \u0026 Issues\n\nContributions are welcome! Please feel free to submit a PR. I am open to significant design changes if they match the project's intention.\n\nIf any critical bugs come up, please open a GitHub issue, feature requests are fine but a PR would be much preferred :p\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Built with [Pillow](https://python-pillow.org/) for image processing (a Pillow wrapper really)\n- Uses [PyYAML](https://pyyaml.org/) for template parsing (by default)\n- This README and parts of the code were partially generated by an LLM, Claude Sonnet 4.5","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorgi-in-tights%2Fposter-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorgi-in-tights%2Fposter-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorgi-in-tights%2Fposter-generator/lists"}