{"id":24344401,"url":"https://github.com/xtream1101/qrcode-xcolor","last_synced_at":"2025-07-13T14:36:53.567Z","repository":{"id":65119782,"uuid":"582197849","full_name":"xtream1101/qrcode-xcolor","owner":"xtream1101","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-26T04:43:05.000Z","size":79,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-18T15:19:35.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/xtream1101.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":"2022-12-26T03:49:47.000Z","updated_at":"2025-04-05T21:21:47.000Z","dependencies_parsed_at":"2022-12-26T07:44:59.910Z","dependency_job_id":null,"html_url":"https://github.com/xtream1101/qrcode-xcolor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xtream1101/qrcode-xcolor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtream1101%2Fqrcode-xcolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtream1101%2Fqrcode-xcolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtream1101%2Fqrcode-xcolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtream1101%2Fqrcode-xcolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xtream1101","download_url":"https://codeload.github.com/xtream1101/qrcode-xcolor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xtream1101%2Fqrcode-xcolor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265156503,"owners_count":23719733,"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":[],"created_at":"2025-01-18T09:35:47.413Z","updated_at":"2025-07-13T14:36:53.539Z","avatar_url":"https://github.com/xtream1101.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QRCode XColor\n\n_Note: This does not work with the qrcode version 7.3.1 in pypi. pypi will not allow git sources in the setup.py requirments so must be manually installed_\n\n**Install qrcode from master branch**\n```bash\npip install git+https://github.com/lincolnloop/python-qrcode.git@8a37658d68dae463479ee88e96ee3f1f53a16f54\n```\n\nThis library recreates a few of the `moduledrawers` classes already found in https://github.com/lincolnloop/python-qrcode.  \n\nThis was done to greatly speed up the generation of creating colored qrcodes, as well as supporting for different colors and styles for the location marker in the corners.  \n\nUsing these custom classes you do lose support for the full features of the `color_mask` argument in the original `QRCode` library like having the colors be a gradient across the qrcode.  \n\nI chose for speed over having that feature with still getting full color and transparency support of the qrcode.  \n\n\nAll supported module drawers:\n\n```python\nfrom qrcode_xcolor import (\n    XStyledPilImage,\n    XSquareModuleDrawer,\n    XGappedSquareModuleDrawer,\n    XCircleModuleDrawer,\n    XRoundedModuleDrawer,\n    XVerticalBarsDrawer,\n    XHorizontalBarsDrawer\n)\n```\nHere are some examples of the speed difference:\n\n```python\nimport time\n\nimport qrcode\nfrom qrcode.image.styledpil import StyledPilImage\nfrom qrcode.image.styles.moduledrawers import GappedSquareModuleDrawer, RoundedModuleDrawer\nfrom qrcode.image.styles.colormasks import SolidFillColorMask\n\nfrom qrcode_xcolor import XStyledPilImage, XGappedSquareModuleDrawer, XRoundedModuleDrawer\n\nst = time.time()\nqr = qrcode.QRCode()\nqr.add_data(\"https://example.com\")\nimg = qr.make_image(\n    image_factory=StyledPilImage,\n    color_mask=SolidFillColorMask(\n        front_color=(59, 89, 152),\n        back_color=(255, 255, 255),\n    ),\n    module_drawer=GappedSquareModuleDrawer(),\n    eye_drawer=RoundedModuleDrawer(),\n    embeded_image_path='docs/gitlab.png',\n)\nimg.save(\"qrcode_color_mask.png\")\nprint(f\"qrcode color_mask: {time.time() - st:.4f}s\")\n\n\nst = time.time()\nqr = qrcode.QRCode()\nqr.add_data(\"https://example.com\")\n# The 4th value in all the colors is the opacity the color should use (0=clear \u003c--\u003e 255=solid)\nimg = qr.make_image(\n    # Custom image factory\n    image_factory=XStyledPilImage,\n    back_color=(255, 255, 255, 255),  # Background color with opacity support\n    module_drawer=XGappedSquareModuleDrawer(\n        front_color=(59, 89, 152, 255),\n    ),\n    eye_drawer=XRoundedModuleDrawer(\n        front_color=(255, 110, 0, 255),\n        inner_eye_color=(65, 14, 158, 255),  # Only valid with the eye_drawer\n    ),\n    embeded_image_path='docs/gitlab.png',  # Still supports embedding logos in the middle\n)\nimg.save(\"qrcode-xcolor.png\")\nprint(f\"qrcode-xcolor: {time.time() - st:.4f}s\")\n```\n\nFrom this test we get the results (exact timings will vary but the difference is always there):\n```\nqrcode color_mask: 0.5071s\n```\n![qrcode color_mask](docs/qrcode_color_mask.png \"qrcode color_mask\")\n```\nqrcode-xcolor: 0.0430s\n```\n![qrcode-xcolor](docs/qrcode-xcolor.png \"qrcode-xcolor\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtream1101%2Fqrcode-xcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxtream1101%2Fqrcode-xcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxtream1101%2Fqrcode-xcolor/lists"}