{"id":15520129,"url":"https://github.com/gabrielepicco/pynter","last_synced_at":"2025-04-23T04:19:29.331Z","repository":{"id":46991665,"uuid":"367831442","full_name":"GabrielePicco/pynter","owner":"GabrielePicco","description":"Minimal Python utility for writing textual caption on images","archived":false,"fork":false,"pushed_at":"2021-10-31T13:47:23.000Z","size":43,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-23T04:19:25.845Z","etag":null,"topics":["image-captioning","write-on-image"],"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/GabrielePicco.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2021-05-16T09:04:19.000Z","updated_at":"2024-09-08T19:48:53.000Z","dependencies_parsed_at":"2022-08-25T16:12:42.972Z","dependency_job_id":null,"html_url":"https://github.com/GabrielePicco/pynter","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielePicco%2Fpynter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielePicco%2Fpynter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielePicco%2Fpynter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GabrielePicco%2Fpynter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GabrielePicco","download_url":"https://codeload.github.com/GabrielePicco/pynter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250366772,"owners_count":21418780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["image-captioning","write-on-image"],"created_at":"2024-10-02T10:24:21.404Z","updated_at":"2025-04-23T04:19:29.311Z","avatar_url":"https://github.com/GabrielePicco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pynter\n======\n\n.. image:: https://img.shields.io/pypi/v/pynter.svg\n    :target: https://pypi.python.org/pypi/pynter\n    :alt: Latest PyPI version\n\nMinimal utility for generating images with textual caption\n\nUsage\n-----\n\n1. Download an image\n\n    curl https://i.imgur.com/XQCKcC9.jpg -o ./image.jpg\n\n2. Download a font\n\n    curl https://fonts.google.com/download?family=Roboto -o ./roboto.zip ; unzip ./roboto.zip -d ./Roboto\n\n3. Provide a caption and Generate the image::\n\n    from pynter.pynter import generate_captioned\n    font_path = './Roboto/Roboto-Regular.ttf'\n    image_path = './image.jpg'\n    im = generate_captioned('China lands rover on Mars'.upper(), image_path=image_path, size=(1080, 1350),\n                            font_path=font_path, filter_color=(0, 0, 0, 40))\n    im.show()\n    im.convert('RGB').save('drawn_image.jpg')\n\n\nResults will look like:\n\n.. image:: https://i.imgur.com/fS6vPNm.jpg\n\n\nImage Generation\n----------------\n\n\ngenerate_captioned(    text: str,\n                       image_path,\n                       size: Optional[Tuple[int, int]] = None, \n                       font_path: str = None,\n                       text_align: TextAlign = TextAlign.LEFT,\n                       bottom_margin: Optional[float] = 0.07,\n                       top_margin: Optional[float] = None,\n                       left_margin: float = 0.2, \n                       right_margin: float = 0.2,\n                       character_ratio: float = 0.07,\n                       filter_color: Tuple[int, int, int, int] = (0, 0, 0, 0),\n                       text_background_color: Tuple[int, int, int, int] = (0, 0, 0, 180),\n                       text_background_padding: float = 0.2,\n                       text_background_mode: TextBackgroundMode = TextBackgroundMode.STRIPE,\n                       filters: [BuiltinFilter] = [],\n                       color: Tuple[int, int, int, int] = (255, 255, 255, 255)) -\u003e Image:\n\n\nInstallation\n------------\n\n   pip install pynter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielepicco%2Fpynter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielepicco%2Fpynter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielepicco%2Fpynter/lists"}