{"id":13585230,"url":"https://github.com/xlzd/img2html","last_synced_at":"2025-12-29T23:26:58.464Z","repository":{"id":62570625,"uuid":"86975648","full_name":"xlzd/img2html","owner":"xlzd","description":"Convert image to HTML","archived":false,"fork":false,"pushed_at":"2022-11-21T10:35:50.000Z","size":4259,"stargazers_count":842,"open_issues_count":10,"forks_count":126,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-03-08T01:15:56.925Z","etag":null,"topics":["funny","image-processing","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xlzd.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}},"created_at":"2017-04-02T09:18:07.000Z","updated_at":"2025-02-12T02:44:28.000Z","dependencies_parsed_at":"2022-11-03T17:15:45.515Z","dependency_job_id":null,"html_url":"https://github.com/xlzd/img2html","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlzd%2Fimg2html","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlzd%2Fimg2html/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlzd%2Fimg2html/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xlzd%2Fimg2html/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xlzd","download_url":"https://codeload.github.com/xlzd/img2html/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247607595,"owners_count":20965944,"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":["funny","image-processing","python"],"created_at":"2024-08-01T15:04:49.062Z","updated_at":"2025-12-29T23:26:58.434Z","avatar_url":"https://github.com/xlzd.png","language":"Python","readme":"# img2html: Convert a image to HTML  [![Version][version-badge]][version-link] ![WTFPL License][license-badge]\n\n\n`img2html` 用于将图片转化为 HTML 页面，并没有什么实际作用，只是为了好玩。\n\n```\n                                 ___      __          __                    ___\n __                            /'___`\\   /\\ \\        /\\ \\__                /\\_ \\\n/\\_\\     ___ ___       __     /\\_\\ /\\ \\  \\ \\ \\___    \\ \\ ,_\\    ___ ___    \\//\\ \\\n\\/\\ \\  /' __` __`\\   /'_ `\\   \\/_/// /__  \\ \\  _ `\\   \\ \\ \\/  /' __` __`\\    \\ \\ \\\n \\ \\ \\ /\\ \\/\\ \\/\\ \\ /\\ \\L\\ \\     // /_\\ \\  \\ \\ \\ \\ \\   \\ \\ \\_ /\\ \\/\\ \\/\\ \\    \\_\\ \\_\n  \\ \\_\\\\ \\_\\ \\_\\ \\_\\\\ \\____ \\   /\\______/   \\ \\_\\ \\_\\   \\ \\__\\\\ \\_\\ \\_\\ \\_\\   /\\____\\\n   \\/_/ \\/_/\\/_/\\/_/ \\/___L\\ \\  \\/_____/     \\/_/\\/_/    \\/__/ \\/_/\\/_/\\/_/   \\/____/\n                       /\\____/\n                       \\_/__/\n```\n\n\n### 示例\n\n转换后的 HTML 页面： [https://xlzd.me/hide/img2html/](https://xlzd.me/hide/img2html/)\n\n\n原始图片             |  转换后\n:-------------------------:|:-------------------------:\n![](https://raw.githubusercontent.com/xlzd/img2html/master/demo/before2.jpg)  |  ![](https://raw.githubusercontent.com/xlzd/img2html/master/demo/after2.png)\n![](https://raw.githubusercontent.com/xlzd/img2html/master/demo/before.png)  |  ![](https://raw.githubusercontent.com/xlzd/img2html/master/demo/after.png)\n\n### 使用方式\n---\n\n#### 命令行\n```\nusage: img2html [-h] [-b #RRGGBB] [-s 4~30] [-c CHAR] [-t TITLE] [-f FONT] -i\n                IN [-o OUT]\n\nimg2html : Convert image to HTML\n\noptional arguments:\n  -b #RRGGBB, --background #RRGGBB  background color (#RRGGBB format)\n  -s (4~30), --size (4~30)          font size (int)\n  -c CHAR, --char CHAR              characters\n  -t TITLE, --title TITLE           html title\n  -f FONT, --font FONT              html font\n  -i IN, --in IN                    image to convert\n  -o OUT, --out OUT                 output file\n```\n\n\n#### 代码调用\n\n```Python\nfrom img2html.converter import Img2HTMLConverter\n\nconverter = Img2HTMLConverter(*some config here*)\nhtml = converter.convert(*image_path*)\n\n# done, so easy.\n```\n\n\n### 安装\n---\n\n`img2html` 已经上传到了 [PYPI](https://pypi.python.org/pypi/img2html)，所以最简单的安装方式就是使用 pip：\n\n```\n$ pip install img2html\n```\n\n更新：\n\n```\n$ pip install img2html --upgrade\n```\n\n\n当然，你也可以通过源码安装：\n\n```\n$ git clone https://github.com/xlzd/img2html.git\n$ cd img2html\n$ python setup.py install\n```\n\n\n### License\n---\n\nWTFPL ([here](https://github.com/xlzd/img2html/blob/master/LICENSE))\n\n\n[version-badge]:   https://img.shields.io/pypi/v/img2html.svg?label=version\n[version-link]:    https://pypi.python.org/pypi/img2html/\n[license-badge]:   https://img.shields.io/badge/license-WTFPL-007EC7.svg\n","funding_links":[],"categories":["Python","Programming Languages"],"sub_categories":["Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlzd%2Fimg2html","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxlzd%2Fimg2html","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxlzd%2Fimg2html/lists"}