{"id":20103476,"url":"https://github.com/swift502/equimercconverter","last_synced_at":"2025-10-13T23:32:04.350Z","repository":{"id":220527686,"uuid":"751878389","full_name":"swift502/EquimercConverter","owner":"swift502","description":"Convert images to equirectangular and mercator projections","archived":false,"fork":false,"pushed_at":"2025-05-28T18:54:02.000Z","size":36039,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-13T23:32:00.667Z","etag":null,"topics":["converter","equirectangular","glsl","mercator","moderngl","projection","python"],"latest_commit_sha":null,"homepage":"https://jblaha.art/projects/projection-converter/","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/swift502.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":"2024-02-02T14:25:15.000Z","updated_at":"2025-10-11T04:25:06.000Z","dependencies_parsed_at":"2024-06-29T18:24:35.163Z","dependency_job_id":"1afa2609-4f80-4b83-9731-03ebcde92a5f","html_url":"https://github.com/swift502/EquimercConverter","commit_stats":null,"previous_names":["swift502/equirectangularmercatorconverter","swift502/equimercconverter"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/swift502/EquimercConverter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FEquimercConverter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FEquimercConverter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FEquimercConverter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FEquimercConverter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swift502","download_url":"https://codeload.github.com/swift502/EquimercConverter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift502%2FEquimercConverter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017238,"owners_count":26086015,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"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":["converter","equirectangular","glsl","mercator","moderngl","projection","python"],"created_at":"2024-11-13T17:36:08.697Z","updated_at":"2025-10-13T23:32:04.345Z","avatar_url":"https://github.com/swift502.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](img/preview.png)\n\n# Equirectangular-Mercator Projection Converter\n\nBi-directional image projection converter. Converts images between equirectangular and mercator projections.\n\nFeatures a fast GPU and a slower CPU conversion implementations:\n\n- The GPU version uses [moderngl](https://github.com/moderngl/moderngl) to transform the image using shaders and then saves it using Pillow\n- The CPU version simply uses [Pillow](https://github.com/python-pillow/Pillow) to modify every pixel individually\n\nThis project therefore contains working examples of Python and GLSL conversion code. Feel free to borrow them and translate them to your language/project.\n\n## Setup\n\n1. Install [Python 3.11+](https://www.python.org/downloads/)\n1. [Clone the repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository)\n1. Install requirements\n```\npip install -r requirements.txt\n```\n\n## Usage\n\n### CLI\n\n```shell\npython convert.py path/to/input_image [--to_equirectangular] [--to_mercator] [--nearest] [--cpu]\n```\n\n| Parameter |  |\n| --- | --- |\n| \u0026#8209;\u0026#8209;to_equirectangular | Convert the image to the Equirectangular projection. |\n| --to_mercator | Convert the image to the Mercator projection. |\n| --nearest | Use nearest sampling for stretching that will occur due to change of aspect ratio. Only used by GPU rendering. |\n| --cpu | Use the CPU rendering implementation. Much slower and doesn't support linear sampling. |\n\n#### Examples\n\n```shell\n# Merc to equi\npython convert.py merc.png --to_equirectangular\n\n# Equi to merc\npython convert.py equi.png --to_mercator\n```\n\n### Python API\n\nYou can use the Converter class directly in Python. Check out the [test script](test.py) to see how to run conversions from code.\n\n## Size limits\n\nInput images have the following size limits:\n\n- GPU (Default)\n  - To Mercator: 32768 x 16384\n  - To Equirectangular: 16384 x 32768\n  - Exceeding these limits will result in `Error: the framebuffer is not complete (INCOMPLETE_ATTACHMENT)`\n- CPU (`--cpu`)\n  - CPU conversion should allow much larger images, but the process is still limited by available system memory. Converting anything above 16384 x 16384 is likely to consume huge amounts of memory. There's also limits imposed by the Pillow library. https://pillow.readthedocs.io/en/stable/reference/limits.html\n\n## Python package\n\nIf anyone wants to transform this into a functional, publishable package, feel free to fork the project and publish it. I don't have enough experience doing that and can't imagine many people will use this thing to make the extra effort worthwhile.\n\n## Image sources\n\n- https://en.wikipedia.org/wiki/File:Equirectangular-projection.jpg\n- https://en.wikipedia.org/wiki/File:Mercator-projection.jpg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift502%2Fequimercconverter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswift502%2Fequimercconverter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift502%2Fequimercconverter/lists"}