{"id":15664475,"url":"https://github.com/minimaxir/mtg-card-creator-api","last_synced_at":"2025-11-07T01:04:35.205Z","repository":{"id":65982415,"uuid":"195494370","full_name":"minimaxir/mtg-card-creator-api","owner":"minimaxir","description":"Code for running a Magic card image generator API","archived":false,"fork":false,"pushed_at":"2019-07-13T20:31:31.000Z","size":727,"stargazers_count":17,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T02:01:44.383Z","etag":null,"topics":["api","flask","magic-the-gathering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minimaxir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"minimaxir","patreon":"minimaxir","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-07-06T03:46:08.000Z","updated_at":"2024-12-18T14:15:47.000Z","dependencies_parsed_at":"2023-02-19T18:45:27.823Z","dependency_job_id":null,"html_url":"https://github.com/minimaxir/mtg-card-creator-api","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/minimaxir%2Fmtg-card-creator-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minimaxir%2Fmtg-card-creator-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minimaxir%2Fmtg-card-creator-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minimaxir%2Fmtg-card-creator-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minimaxir","download_url":"https://codeload.github.com/minimaxir/mtg-card-creator-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252752061,"owners_count":21798723,"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":["api","flask","magic-the-gathering"],"created_at":"2024-10-03T13:42:46.384Z","updated_at":"2025-11-07T01:04:35.148Z","avatar_url":"https://github.com/minimaxir.png","language":"Python","funding_links":["https://github.com/sponsors/minimaxir","https://patreon.com/minimaxir","https://www.patreon.com/minimaxir"],"categories":[],"sub_categories":[],"readme":"# mtg-card-creator-api\n\n![](/card_image_examples/mark_rosewater.jpg)\n\nAPI to create Magic card images by using [Magic Set Editor](http://magicseteditor.sourceforge.net) and [wine](https://www.winehq.org), enclosed in a Docker container. Input is an encoded card string via [mtg-gpt-2-cloud-run](https://github.com/minimaxir/mtg-gpt-2-cloud-run), outputs are Gatherer-formated text and a card image.\n\nThe API wraps code from Bill Zorn's [mtgencode](https://github.com/billzorn/mtgencode) (MIT, and Python 2 so the container includes a Python 2.7 runtime), and Magic Set Editor to render the cards into JPEGs.\n\nThis is *incredibly* jank programming, but it is not the bottleneck in the card generation (the GPT-2 text generation is) and streamlining the code workflow would not have a noticable effect on performance (image generation currently takes about 3s while card generation takes 10s-30s).\n\nNB: The container will not work on [Google Cloud Run](https://cloud.google.com/run/) itself since the processor architecture forbids [running 32-bit apps](https://cloud.google.com/run/docs/reference/container-contract) like wine.\n\n## Installation\n\nBecause the licensing for Magic Set Editor and fonts are ambigious, they are not included in this repo:\n\n* For Magic Set Editor, download Basic [Magic Set Editor 2.0.1](http://magicseteditor.boards.net/page/downloads) (*not* 2.0!) and move the resulting `MSE` folder to the repo folder.\n* For the fonts, download the \"Fonts for Magic Templates\" [here](http://msetemps.sourceforge.net/phpBB3/viewtopic.php?t=144#p601). Copy the fonts from the `Magic - All` and `Magic - After M15` folders into a `fonts` folder in the repo folder.\n\n## Helpful Notes\n\n* The image is returned as a base64-encoded string. It's the user's responsibility to add an approrpiate MIME-type if necessary.\n* The card formatting issues are due to the underlying mtgencode/MSE implementations and are not easy to fix (most notable with Planeswalker cards). I am not actively searching for fixes, but will accept suggestions/PRs.\n\n## Maintainer/Creator\n\nMax Woolf ([@minimaxir](https://minimaxir.com))\n\n*Max's open-source projects are supported by his [Patreon](https://www.patreon.com/minimaxir). If you found this project helpful, any monetary contributions to the Patreon are appreciated and will be put to good creative use.*\n\n## License\n\nMIT\n\n## Disclaimer\n\nThis repo has no affiliation or relationship with Wizards of the Coast.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminimaxir%2Fmtg-card-creator-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminimaxir%2Fmtg-card-creator-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminimaxir%2Fmtg-card-creator-api/lists"}