{"id":34029105,"url":"https://github.com/gibiee/img64","last_synced_at":"2026-04-07T17:31:59.666Z","repository":{"id":210239944,"uuid":"725536775","full_name":"gibiee/img64","owner":"gibiee","description":"This library encodes and decodes an image in base64 format.","archived":false,"fork":false,"pushed_at":"2025-06-05T08:23:05.000Z","size":3211,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-15T07:38:32.061Z","etag":null,"topics":["base64","base64-decoding","base64-encoding","image","image-decoding","image-encoding","image-processing","images"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/img64","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/gibiee.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}},"created_at":"2023-11-30T10:56:21.000Z","updated_at":"2025-06-05T08:23:08.000Z","dependencies_parsed_at":"2024-01-10T18:12:30.334Z","dependency_job_id":"2e34aa43-92aa-43f1-b6a1-3d4e93fe8549","html_url":"https://github.com/gibiee/img64","commit_stats":null,"previous_names":["gibiee/img64"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gibiee/img64","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibiee%2Fimg64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibiee%2Fimg64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibiee%2Fimg64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibiee%2Fimg64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gibiee","download_url":"https://codeload.github.com/gibiee/img64/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gibiee%2Fimg64/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31522271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["base64","base64-decoding","base64-encoding","image","image-decoding","image-encoding","image-processing","images"],"created_at":"2025-12-13T17:26:40.064Z","updated_at":"2026-04-07T17:31:59.654Z","avatar_url":"https://github.com/gibiee.png","language":"Python","readme":"![PyPI - Version](https://img.shields.io/pypi/v/img64)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/img64?color=red)\n![PyPI - License](https://img.shields.io/pypi/l/img64)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/img64)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/gibiee/img64/assets/37574274/1e4ba6f4-776d-4e84-b589-09f75d64d175\" width=\"50%\" height=\"50%\" /\u003e\n\u003c/p\u003e\n\nThis library encodes and decodes an image in base64 format.\n\n\n# Installation\n```sh\npip install img64\n```\n\n\n# Quick start\n\n## Convert Image to Base64\n```py\nfrom PIL import Image\nimport cv2\nimport img64\n\n# PIL image to Base64\nimage = Image.open('sample.png')\nbase64 = img64.image_to_base64(image)\nbase64[:30] # 'iVBORw0KGgoAAAANSUhEUgAABAAAAA...'\n\n# Numpy(OpenCV) image to Base64\nimage = cv2.imread('sample.png')\nimage = cv2.cvtColor(image, cv2.COLOR_BGRA2RGBA)\nbase64 = img64.image_to_base64(image)\nbase64[:30] # 'iVBORw0KGgoAAAANSUhEUgAABAAAAA...'\n```\n\n## Convert Base64 to Image\n```py\nimport img64\n\n# Base64 to PIL image\nbase64 = 'iVBORw0KGgoAAAANSUhEUgAABAAAAA...'\nimage = img64.base64_to_image(base64, type='pil')\ntype(image) # PIL.Image.Image\n\n# Base64 to Numpy(OpenCV) image\nbase64 = 'iVBORw0KGgoAAAANSUhEUgAABAAAAA...'\nimage = img64.base64_to_image(base64, type='numpy')\ntype(image) # numpy.ndarray\n```\n\n# Information\n- It was implemented by referencing [ternaus/base64ToImageConverters](https://github.com/ternaus/base64ToImageConverters).\n  - The referenced library doesn't ensure data consistency, but this library addresses that issue.\n  - This library enhances user convenience in handling both RGB and grayscale images.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgibiee%2Fimg64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgibiee%2Fimg64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgibiee%2Fimg64/lists"}