MTG.Design Vector-Based Rendering Engine
by Nate and Snacko
Moderators: Snacko, CCGHQ Admins
MTG.Design Vector-Based Rendering Engine
by proud » 24 Feb 2022, 06:53
MTG.Design Vector-Based Rendering Engine
Hi everyone!
A brief bit of history.
I started MTG.Design back in 2014. (“ancestral” is my other handle.) I was looking for a 300 dpi source, and was happy to see ahkren had been working on HQ Cardgen, and had everything I needed. (I owe you a debt of gratitude! I would love to send you something — get in touch with me.) But within a year or two, ahkren became busy, and HQ Cardgen no longer had a maintainer. I was a de facto steward, but wasn’t familiar with the rendering portion, as I had developed my own text renderer.
Fast forward a few more years. Other options have become available, but I tired of pushing pixels and fussing over destructive and tedious image editing. I ended up deciding a fully vector-drawn approach (with exception to background textures) was going to be the very best option. When I didn’t find the right artist to take this on, I self-taught myself SVG, acquainted myself with Affinity Designer and Inkscape, and here we are today.
The next-gen MTG.Design renderer.
Attached are some samples.
https://github.com/MTG-Design/resources
Resources are split into individual components, the recipes how how to build the cards, and the PHP and LaTeX rendering files. Components include items such as accents, backgrounds, boxes, borders, and shadows. Recipes indicate which components to use, what effects to apply, and where to place them on a card. Rendering files composite the graphics with LaTeX text.
Currently, the components and recipes are included.
Some rendering support has been enabled, but it is unfinished.
Requirements
build.php builds the .ini recipe files into SVG or PNG images. (To export to PNG, inkscape is recommended for proper SVG export. (Not all graphics applications fully implement the SVG 1.1 specification.)
When cards are built, they will save to /cards by default.
render.php renders the text using XeLaTeX. You must install it on your system if you want to render text on cards.
(Fonts are not in this repository; it is up to the user to source their font files. I’ll add support for substitute fonts.)
The following LaTeX packages are required:
You can add new types of cards by creating a new recipe file. (Guidance and help on how to write recipe files will be added in the future.)
Contribute
MTG.Design is being actively worked on, with frames being uploaded only when they are considered ready. If you have components or recipes to add, please file a pull request and they will be reviewed.
You can donate to MTG.Design using Patreon.
About
MTG.Design was created using the MIT license by ancestral of Spellshapers, LLC.
Images in /background, /title, /typeline and /stamp may contain trademarks and be copyright of Wizards of the Coast, LLC, a subsidiary of Hasbro, Inc.
MTG.Design is not affiliated with, endorsed, sponsored, or specifically approved by Wizards of the Coast LLC.
Hi everyone!
A brief bit of history.
I started MTG.Design back in 2014. (“ancestral” is my other handle.) I was looking for a 300 dpi source, and was happy to see ahkren had been working on HQ Cardgen, and had everything I needed. (I owe you a debt of gratitude! I would love to send you something — get in touch with me.) But within a year or two, ahkren became busy, and HQ Cardgen no longer had a maintainer. I was a de facto steward, but wasn’t familiar with the rendering portion, as I had developed my own text renderer.
Fast forward a few more years. Other options have become available, but I tired of pushing pixels and fussing over destructive and tedious image editing. I ended up deciding a fully vector-drawn approach (with exception to background textures) was going to be the very best option. When I didn’t find the right artist to take this on, I self-taught myself SVG, acquainted myself with Affinity Designer and Inkscape, and here we are today.
The next-gen MTG.Design renderer.
Attached are some samples.
https://github.com/MTG-Design/resources
Resources are split into individual components, the recipes how how to build the cards, and the PHP and LaTeX rendering files. Components include items such as accents, backgrounds, boxes, borders, and shadows. Recipes indicate which components to use, what effects to apply, and where to place them on a card. Rendering files composite the graphics with LaTeX text.
Currently, the components and recipes are included.
Some rendering support has been enabled, but it is unfinished.
Requirements
- PHP 8.1 or newer
- XeLaTeX, with several packages installed
- Inkscape, in order to save SVGs to a differnet format (like PNG or PDF)
build.php builds the .ini recipe files into SVG or PNG images. (To export to PNG, inkscape is recommended for proper SVG export. (Not all graphics applications fully implement the SVG 1.1 specification.)
When cards are built, they will save to /cards by default.
render.php renders the text using XeLaTeX. You must install it on your system if you want to render text on cards.
- Code: Select all
usage: render.php <format> <path>
Formats:
-l LackeyBot JSON format
-m MTGJSON JSON format
-n Start rendering at card number
-s Scryfall JSON format
(Fonts are not in this repository; it is up to the user to source their font files. I’ll add support for substitute fonts.)
The following LaTeX packages are required:
- Code: Select all
textpos
calc
xcolor
fontspec
lmodern
hyphenat
enumitem
graphicx
setspace
You can add new types of cards by creating a new recipe file. (Guidance and help on how to write recipe files will be added in the future.)
Contribute
MTG.Design is being actively worked on, with frames being uploaded only when they are considered ready. If you have components or recipes to add, please file a pull request and they will be reviewed.
You can donate to MTG.Design using Patreon.
About
MTG.Design was created using the MIT license by ancestral of Spellshapers, LLC.
Images in /background, /title, /typeline and /stamp may contain trademarks and be copyright of Wizards of the Coast, LLC, a subsidiary of Hasbro, Inc.
MTG.Design is not affiliated with, endorsed, sponsored, or specifically approved by Wizards of the Coast LLC.
- Attachments
-
- 3 Blue Ox.svg.txt
- Blue Ox token
- (162.57 KiB) Downloaded 315 times
-
- 1 Goat.svg.txt
- Goat token
- (329.28 KiB) Downloaded 314 times
aka ancestral, mproud
MTG.Design
MTG.Design
Re: MTG.Design Vector-Based Rendering Engine
by Huggybaby » 03 Jul 2022, 01:33
How did I miss this post?
Thanks proud!
Thanks proud!
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 702 times
- Been thanked: 595 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests