/mtg-autoproxy

Use Photoshop scripting to easily create custom high-quality Magic proxies for casual play

Primary LanguageJavaScript

MTG Autoproxy

Use Photoshop scripting to easily create custom high-quality Magic proxies for casual play.

If you found this tool and/or my renders useful, you could shout me a cup of coffee if you felt like it <3

paypal

Google Drive full of MPC ready cards

Examples

Video demonstration

Original digital render example img1

Example printed through http://makeplayingcards.com img2

What You'll Need

  • A copy of Photoshop. I tested the system using CS5 and CC 2018, but other versions may work as well.
  • The Photoshop templates (download the desired templates in the Automated folder - hopefully the filenames are self-explanatory)
  • The following fonts:
  • json2.js, included but you may need to download a more recent version.

As well as the Python packages (I tested the script using Python 3.6.3):

  • json
  • Scrython
  • requests

Install / Usage Guide

  • Clone to a folder of your choice, referred to as the working directory.
  • Install the included font and the other fonts specified above.
  • Download the Photoshop templates, create a folder called templates in the working directory, and extract them into the folder.
  • Create a folder called art in the working directory, and another called out. Create a folder called border inside out.
  • Move all of your card artwork to the art folder. File names should be structured as <CARDNAME> (<ARTIST NAME>).jpg.
  • Run the script proxyAll to render each card in the art folder, and store the results in the out folder. proxyTarget does the same but only for a specific art image.
  • Run the script borderifyAll to pad each card render with a black border, such that it's ready to order through sites like http://makeplayingcards.com, and store the results in the border folder inside the out folder. borderifyTarget does the same but only for a specific render.
  • Toggle comments on the first couple of lines of proxy.jsx to switch between the normal template and box topper template. Box topper renders don't need to be borderified.

FAQ

Photoshop scripting works within an outdated version of JavaScript and has more than its share of idiosyncrasies. There are unfortunately bugs that don't occur on my system and that I can't recreate, but others have found ways to fix them.

  • When I load the template, Photoshop tells me I'm missing a font called MTG2016. Try updating your templates - this should be fixed for everyone now. Feel free to raise an issue if it's not though!
  • When I render a card, the artwork is twice as big as it should be. Open excessFunctions.jsx, and at the top there should be the line var artScaleFactor = 100;. Change this to equal 50 instead of 100, and that typically fixes it.
  • My set symbols don't have the proper gradient to them. Clone the latest version of the repo, and download the most recent version of the templates - this should hopefully be fixed for everyone now. Feel free to raise an issue if it's not though!
  • I want to change the set symbol to something else. Head over to https://andrewgioia.github.io/Keyrune/cheatsheet.html - you can use any of these symbols for the set symbol for your cards. Copy the text of the symbol you want on the cheatsheet, then hop into proxy.jsx and look about 10 lines down. Replace the square character in quotations with the character you copied.
  • The script doesn't seem to be saving card.json properly. The get_card_info.py script works properly from the command line. Seems like this issue arises from PS running the Python script in a different directory, and running into permissions issues. Clone the latest version of the repo if you haven't already, because I'm fairly certain I've fixed the root cause of this issue. Failing that, a couple of users have had success with modifying file permissions - try chmod 777 card.json, or sudo chmod a+rw . in the root work directory.
  • I'm getting an error that looks like "error 23: ) does not have a value. Line: 1" This is usually related to the above issue.

Limitations

As of this release, the script can't handle:

  • Automation of cards that aren't one of the following: cards with the normal frame, transform cards (fronts and backs, including Ixalan transform lands), meld cards, planeswalker cards, or basic lands. Included in the Templates drive, however, I have templates for the following which you can use manually: Sagas, level-up cards, adventure cards, full-art promos (e.g. Lightning Bolt, Path to Exile), and Kaladesh Invention masterpieces.
  • Full automation of planeswalkers. The script does most of the heavy lifting, but requires the user to manually position the text as a final step. My typical workflow for planeswalkers is to run the script up until it errors, then position the inserted Scryfall scan to fill the canvas. From here, I resize the text layers until they line up with the real card, then reposition the art if necessary. Save As and saving as a PNG with the default settings is fine.
  • Devoid-style frames, miracle-style frames, and draft-matters frames - these will be added eventually but they're not a high priority.
  • Quoting something in a card's flavour text without italics. See: Yarok the Desecrated, Phyrexian Altar.

CoffeeKing extras

Command line

  • To run js from the command line do:
$ python3 run_script.py -ps (PHOTOSHOP TARGET) -js (JS FILE)
  • The photoshop target can just be the code (CS6 or CC 2017)
  • The js file can be relative, python will make it absolute
  • Only configure to handle for MacOS
    • May need to change for other platforms, but it will only be the part where the command is called
    • Also, if there is a better way to call from MacOS, please tell me (but it works sooooo)
  • Can also make use of config.json (must copy copy_me_config.json to config.json)
    • This can be used to house over variables in the future, seemed like a cool idea
  • If you fill out photoshopTarget and/or javascriptToRun, you don't have to add -ps and -js args, just call
$ python3 run_script.py
  • Using Python 3.8.6, only compatibility issue I think there could be is that I make use of f-Strings (Not 100% sure)
  • Should do:
pip install -r requirements.txt 
  • Nothing extra installed yet, for future maybe?