Giter VIP home page Giter VIP logo

mtg-vectors's Introduction

Magic the Gathering Vectors

A repository of Magic the Gathering SVG (vector) files for set, watermark, and miscellaneous symbols. If you wish to contribute to this repository, please check our missing vectors list. This list is generated automatically every week to ensure the repository remains updated as new symbols are released.

GitHub file size in bytes GitHub last commit GitHub License Static Badge Discord

๐Ÿ’Œ How can I support the project?

Feel free to join our community discord where we test, improve, and release all kinds of awesome MTG related tools and templates. Also, please consider supporting me on Patreon which pays for hosting costs, gives me time to expand and maintain this repository and other API datasets, and helps me build a ton of cool stuff like Proxyshop, MTG Art Downloader, the Hexproof API and more! If Patreon isn't your thing, you can also buy me a coffee via PayPal. Thanks so much to our awesome supporters!

Python CLI

This repository includes a small Python project, the scope of which is contained within the src directory. This project provides a variety of CLI commands for gathering Scryfall data, testing our existing SVG catalogue against existing sets, generating a MISSING.md file tracking symbols currently missing from the repository, generating a symbol manifest file, and building a zip package that can be distributed to outside apps when the repository is updated.

Python Setup (Poetry)

We like to use Poetry for managing the project environment, dependencies, etc. It is highly recommended to setup this project using the Poetry method, ESPECIALLY if you plan to contribute to the project. If you wish to set up the project without using Poetry, skip to this section.

  1. Install poetry if you don't have it.
    # 1: Install pipx and ensure path.
    py -m pip install --user pipx
    py -m pipx ensurepath
    
    # 2: Install poetry and check that it works
    pipx install poetry
    poetry --version
    
    # 3: [Recommended] Configure poetry to create virtual environments in-project.
    poetry config virtualenvs.in-project true
  2. Clone the mtg-vectors repository somewhere on your system and install the project environment with Poetry.
    # 1: Clone and enter the project.
    git clone https://github.com/Investigamer/mtg-vectors.git
    cd mtg-vectors
    
    # 2: Install the poetry environment.
    poetry install
  3. The project is now set up. You can now run our utility scripts via the CLI:
    # See the "test" scripts available
    vectors test --help
    
    # See the "build" scripts available
    vectors build --help

Python Setup (Without Poetry)

  1. If you don't feel like using Poetry (you really should, it's great!) you can install the Python project using the good old fashion pip. First lets clone the mtg-vectors repository somewhere on your system:
    # Clone and enter the project.
    git clone https://github.com/Investigamer/mtg-vectors.git
    cd mtg-vectors
  2. Next, create a Python virtual environment (highly recommended) and install our dependencies to it.
    # 1: Create a virtual environment
    py -m venv .venv
    
    # #2: Enter the virtual environment
    .venv/scripts/activate # For Windows
    source .venv/bin/activate # MacOS or Linux
    
    # 2: Install our project dependencies.
    pip install -r requirements.txt
  3. The project is now set up. You can now run our utility scripts via the CLI:
    # See the "test" scripts available
    py src/cli.py test --help
    
    # See the "build" scripts available
    py src/cli.py build --help

Design Standards

  1. Try to create symbols from scratch in a software like Adobe Illustrator, using a WoTC official rasterized asset as a guide. SOMETIMES you can use the Scryfall SVG linked next to an item in the MISSING.md reference file as a starting place, but do keep in mind Scryfall-provided SVG icons can often be inaccurate or poorly created.
  2. For rarity colors, you must either sample colors from a WoTC official raster asset, or use the commonly held rarity colors from previous symbols. Please note that the rotation and spectrum of the gradient changes pretty frequently over different symbols, please try to replicate the look of the specific symbol you are re-creating.
  3. For non-rarity colors present in the symbol, always sample from an official WoTC provided raster asset. Don't just wing it.
  4. When creating a new symbol, we ask that you please generate at-minimum these rarities: WM, C, U, R, M, T
  5. I know that the "T" rarity is only used in a handful of sets, but we try to maintain this rarity across the board for the benefit of custom cards, designing custom cubes, and other creative activities. WM represents the "watermark" version of a set symbol and should have no outline (one solid black layer).
  6. PLEASE, when you are finished with an SVG file, make sure to save or export it with no transparent margin/space around the symbol. Do not save the file as a symbol inside a larger transparent bounding box, or an art board that is larger than the symbol itself. If using Illustrator, join the symbol layers into one group, select that group, and Right Click -> Export Selection. We are trying to enforce all symbols having no extra margin space.

Data Standards

  1. All real card data is gathered from Scryfall, and with very few exceptions we try to use Scryfall equivalent naming conventions when dealing with symbol mapping, naming, sorting, etc.
  2. For data files (confined to the /data/ directory), we prefer to use the human-readable YAML .yml format.
  3. For the manifest file manifest.json, we prefer to use JSON .json for its unrivaled performance, since this file is application-focused.
  4. All vector assets are located in the /svg/ directory, currently separated into two categories:
    • 'Set' Symbols, those found on the right hand side of a card's typeline.
    • 'Watermark' Symbols, those found in the textbox of certain cards, behind the rules text.
  5. For user reference or documentation files (currently just MISSING.md), we prefer the widely supported and formatting rich Markdown .md format.
  6. When interpreting inconsistencies or undesirable mappings in Scryfall data, we consider the following:
    • Did Scryfall map the incorrect symbol because the real cards use a mix of different symbols?
    • Did Scryfall map the incorrect symbol because the symbol changed after the set was printed?
    • Did Scryfall map the incorrect symbol because they don't have the asset and never bother to add it?
    • Did Scryfall map the incorrect symbol because of purely user error?
    • Is there a symbol we have that can act as a clean replacement for the incorrect Scryfall mapping?

The Symbol Manifest File

The manifest for this repository (manifest.json) contains the following information:

  1. meta โ€” This key tracks metadata about the current state of the repository.
    • date โ€” The date when the current manifest was generated.
    • version โ€” The version of the current manifest, combines the version of the repository and date this manifest was generated.
    • uri โ€” URL pointing to the live hosted ZIP package of all vectors catalogued in the repository at the time this manifest was generated.
  2. set โ€” This key tracks all information pertaining to "set" symbol vectors.
    • route โ€” A dictionary mapping some set codes to a specific symbol code. Typically, a set is assigned a manual routing in this dictionary because in our view Scryfall's provided icon for this set is incorrect. We also try to enforce one code for all symbols in the repository, and Scryfall has a few cases where the same icon is given multiple icon names. In these cases we try to choose the most sensible of these names and re-route any duplicates to the preferred one. See the Other Data Files section for more info.
    • symbols โ€” A dictionary of all symbol codes found in this repository mapped to a list of rarities currently supported by that symbol.
  3. watermark โ€” This key tracks all information pertaining to "watermark" symbol vectors.
    • routes โ€” A dictionary which might map certain watermark names to other watermark names. Currently empty.
    • symbols โ€” A list of currently recognized watermark symbol names.

Other Data Files

  1. /set/alies.yml โ€” Tracks Scryfall "icon" resources that have multiple codes. The key represents the code we've chosen as "canon" for that symbol. The value is a list of all codes Scryfall has associated with this symbol at varying times.
  2. /set/corrected.yml โ€” Tracks sets that Scryfall has assigned a seemingly incorrect icon code to. The key represents the set's "code", the value represents the symbol code we have chosen to route this set to.
  3. /set/empty.yml โ€” Tracks a list of sets that have no defined icon on Scryfall.
  4. /set/ignored.yml โ€” Tracks s list of directory names in our symbol catalog that are not recognized icon names on Scryfall.
  5. /set/mixed.yml โ€” Tracks a list of sets that have a variety of different symbols, please note that generally Scryfall will assign the "DEFAULT" code to these, but not always. In the future we plan to create additional mappings that allow users to route individual cards in a given set to specific symbols to help deal with this scenario.
  6. /set/rarities.yml โ€” Tracks all the rarities recognized by this repository.
  7. /set/routes.yml โ€” Tracks a dictionary of set codes manually routed to symbol codes. Keys are valid Scryfall set codes, values are symbol codes from our catalog. This dictionary is the culmination of many hours of analyzing Scryfall set data, it was migrated to this project from my app Proxyshop and heavily modified thereafter to meet the requirements of the project. It is compiled by synthesizing, combining, and interpolating the other data files into a unified mapping, only re-routing sets which have a different icon code on Scryfall (for any reason). The routes dictionary in our generated manifest.json is sourced from this dictionary at the time the manifest is generated.
  8. /watermark/ignored.yml โ€” Tracks a list of watermark names recognized by Scryfall that do exist in this catalog, but don't share the same filename.
  9. /watermark/mixed.yml โ€” Tracks a list of watermark names recognized by Scryfall that represent multiple different symbols. We need to formalize a methodology for mapping each specific occurrence of this watermark name to the appropriate vector asset.

mtg-vectors's People

Contributors

investigamer avatar jordi735 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.