A tool to assemble Magic: The Gathering proxies from a set of template images

Overview

Proximity

A tool to assemble Magic: The Gathering proxies from a set of template images. To get started, check out the wiki.

Building

Proximity can be built using the command gradlew shadowJar, or by running the shadowJar task in your IDE.

Comments
  • Colorless Cards

    Colorless Cards

    First of all I love all the work you've put into this tool. Now I was wondering if there is a way to trick the tool to use the artifact frame for colorless cards, like Devoid cards? Cause right now it returns a transparent frame, while still using the crop art rather than the full art.

    opened by Phobia9651 8
  • Cannot invoke

    Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null

    running jdk 17.0.1 and proximity 0.4.0 is working but proximity 0.5.0 and 0.5.1 not working, getting below messages: WARNING: A terminally deprecated method in java.lang.System has been called WARNING: System::setSecurityManager has been called by dev.hephaestus.proximity.Main WARNING: Please consider reporting this to the maintainers of dev.hephaestus.proximity.Main WARNING: System::setSecurityManager will be removed in a future release ERROR [Proximity] Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null

    opened by maso222 5
  • Malformed Input Exception

    Malformed Input Exception

    using version 0.5.2

    getting an error using long dash in type_line override the below type line was copied from scryfall and the word Creature removed but throws error due to an issue with the long dash

    Ertai, the Corrupted --override=type_line:"Legendary — Phyrexian Human Wizard"

    java.nio.charset.MalformedInputException: Input length = 1 at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274) at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326) at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188) at java.base/java.io.InputStreamReader.read(InputStreamReader.java:177) at java.base/java.io.BufferedReader.fill(BufferedReader.java:162) at java.base/java.io.BufferedReader.readLine(BufferedReader.java:329) at java.base/java.io.BufferedReader.readLine(BufferedReader.java:396) at dev.hephaestus.proximity.Main.loadCardsFromFile(Main.java:74) at dev.hephaestus.proximity.Main.lambda$main$2(Main.java:57) at dev.hephaestus.proximity.util.Result.then(Result.java:45) at dev.hephaestus.proximity.Main.main(Main.java:56)

    opened by maso222 4
  • Local art resolver

    Local art resolver

    Implements a resolver for finding local art. This resolver looks in a folder called art located at $PWD at the time of execution (i.e. next to the proximity.jar, or in the root of the java project).

    If no local art is found, or the art directory doesn't exist, it falls back to using the old resolver.

    If the --use_official_art flag is not set to true, the ArtLayer won't be rendered anyway.


    There are some caveats to this implementation that I would like some input on, and I am not entire sure how we should handle it. I implemented a way to assign a set to an image, and if a set it assigned, it trumps images with a set assigned (given that you try to render a card of said set). But every card that is rendered has a set by default, since scryfall defaults to the latest printing of a card if no set is explicitly assigned.

    So say you want to render:

    1 Counterspell
    1 Counterspell (MH2)
    

    And you got two images:

    art/counterspell.jpg
    art/mh2/counterspell.jpg
    

    In this case, I would assume the creator would like one counterspell of each art to be rendered, since they assigned set to one of them and not to the other. But in reality, since MH2 is the most recent printing of counterspell, they would get two counterspell with the MH2 art.

    I am not entirely sure how we could work around this. One solution would be to just accept it, and move on. Another would be to add a property to the RenderableCard object where you can see if set comes from the Scryfall responses or from the cards file, and we can assign art by only using the set code from the cards file.

    opened by Gikkman 4
  • SVG processing error

    SVG processing error

    When trying out set SVG set symbols from CCGHQ forums (https://www.slightlymagic.net/forum/viewtopic.php?f=15&t=7010) I encountered an NPE during processing (SVGLayerRendered.java, line 53). This is due to SVG files missing viewbox attribute in the svg element, only width/height attributes are present as seen in the sample: R.svg.txt.

    Current code for this looks like this:

    SVGRect svgBounds = root.getViewBox().getBaseVal();
    double svgWidth = svgBounds.getWidth(), svgHeight = svgBounds.getHeight();
    

    Unfortunately the batik API doesn't have a simple way of checking if the viewbox attribute is available, so a simple workaround I'm using right now uses this:

    double svgWidth, svgHeight;
    SVGRect svgBounds = root.getViewBox().getBaseVal();
    try {
      svgWidth = svgBounds.getWidth();
      svgHeight = svgBounds.getHeight();
    }
    catch (Exception ex) {
        svgWidth = root.getWidth().getBaseVal().getValue();
        svgHeight = root.getHeight().getBaseVal().getValue();
        svgBounds.setX(0);
        svgBounds.setY(0);
        svgBounds.setWidth((float)svgWidth);
        svgBounds.setHeight((float)svgHeight);
    }
    

    But I suppose it can be made even better...

    bug 
    opened by yaceek 4
  • getFileSystem error on versions 0.5.x

    getFileSystem error on versions 0.5.x

    Hi, first of all thanks for the repo, super cool.

    I was testing version 0.4.0 a couple of weeks ago and I had no problem whatsoever. However, moving to 0.5.x, I get the following stack:

    INFO  [Proximity] Fetching info for 1 cards...
    1/1
    INFO  [Proximity] Successfully found 1 cards. Took 512ms
    INFO  [Proximity] Rendering 1 cards on 1 threads
    ERROR [Proximity] 0/1     41ms  Sword of Feast and Famine                               FAILED
    ERROR [Proximity] Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null
    DEBUG [Proximity] java.base/java.nio.file.Files.provider(Files.java:105)
    DEBUG [Proximity] java.base/java.nio.file.Files.isDirectory(Files.java:2316)
    DEBUG [Proximity] dev.hephaestus.proximity.Proximity.save(Proximity.java:458)
    DEBUG [Proximity] dev.hephaestus.proximity.Proximity.render(Proximity.java:440)
    DEBUG [Proximity] dev.hephaestus.proximity.Proximity.renderAndSave(Proximity.java:397)
    DEBUG [Proximity] dev.hephaestus.proximity.util.Result.then(Result.java:45)
    DEBUG [Proximity] dev.hephaestus.proximity.Proximity.run(Proximity.java:87)
    DEBUG [Proximity] dev.hephaestus.proximity.util.Result.ifPresent(Result.java:66)
    DEBUG [Proximity] dev.hephaestus.proximity.Main.main(Main.java:60)
    INFO  [Proximity] Done! Took 563ms
    

    I am running java -jar proximity-0.5.2.jar --cards=card_list.txt --template=chillis.zip from a docker image based on openjdk:16 (openjdk:17 works all the same). Build 0.4.0 still works fine, though.

    Any idea where this might be coming from? Thanks!

    opened by eduardocarvp 2
  • Bottom-line overlap when generating cards on linux

    Bottom-line overlap when generating cards on linux

    When generating a card of of the Ubuntu docker image, I get the following bottom line:

    image

    But when I generate images from my Mac, I get the following bottom line:

    image

    I don't know if this is an issue with my docker image, or if it is an image with native fonts on Ubuntu

    bug 
    opened by Gikkman 2
  • Artist Name font is wrong and size is to big

    Artist Name font is wrong and size is to big

    Compared a Proximity render to other existing scans in Photoshop and the Artist Name font is off and the size is too big by what looks to be about 2 points.

    Top line is Proximity, bottom one is existing card scan Untitled-2

    enhancement good first issue 
    opened by joshuabengal 2
  • Unclear required directory template_overrides

    Unclear required directory template_overrides

    Wiki getting started instructions mention creating a templates directory, but it looks like both that and a templates_overrides directory are required as there's an explicit load of it here.

    https://github.com/Haven-King/Proximity/blob/ce870d9403244de55801e19a94e88c09c0d5b291/src/main/java/dev/hephaestus/proximity/Main.java#L140

    The exception message thrown doesn't mention the path it was trying, so it's a bit hard to diagnose what the issue is.

    https://github.com/Haven-King/Proximity/blob/ce870d9403244de55801e19a94e88c09c0d5b291/src/main/java/dev/hephaestus/proximity/templates/FileSystemTemplateSource.java#L30

    opened by haganbmj 1
  • Consider allowing older versions of java to run the pre-built jars

    Consider allowing older versions of java to run the pre-built jars

    Both versions of java I have installed on my machine (OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.9.1+1) and Java(TM) SE Runtime Environment (build 1.8.0_251-b08)) were built in 2020 and yet neither of them is even close to being able to run the jars built on the release page. I bet most other people's versions of Java are even older.

    When I try and run it, I get this:

    Error: LinkageError occurred while loading main class dev.hephaestus.proximity.Main
            java.lang.UnsupportedClassVersionError: dev/hephaestus/proximity/Main has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 55.0
    
    opened by alexander-novo 1
  • Missing color indicator for transforming DFCs, redundant p/t

    Missing color indicator for transforming DFCs, redundant p/t

    Really minor issue, but the render for the backside of transforming double-faced cards is missing the colored circle by the typeline that indicates the card's color. See Avacyn the Purifier as an example. Also, the backside of TDFCs include the front side's power/toughness, which is wrong. Only the front of a TDFC includes reminder power/toughness for the back. Not the other way around.

    bug enhancement 
    opened by malgox 1
  • bullet italics dash

    bullet italics dash

    having a little issue with the cards Black Market Connections and Dawnbringer Cleric

    seems there is some bad synergy when having bullet and italics/dash

    testing the issue I overloaded the oracle and can remove bullet or i can remove dash and it works but cannot have both together like that for some reason

    opened by maso222 1
  • Wiki incomplete

    Wiki incomplete

    Hello @Haven-King !

    I've made a Mardown page to explain how to use the myojin223 Ready to Use Proximity.

    I can't make a PR for the Wiki page, so I made an Issue here :)

    opened by PedroLuisBernardos 1
  • dash in card name

    dash in card name

    Just having a small issue with 0.5.2 with any cards that have a dash in the card name, the dash is not included in the file name. For example Snow-Covered Forest

    opened by maso222 0
  • Image compression and command line option to drop alpha layer

    Image compression and command line option to drop alpha layer

    Currently Proximity is saving the PNG in RGBA with no or very little compression. The Alpha is needed for people making frames to then edit later but for many use cases it would be nice to have the option to drop the alpha layer as an option.

    This is some example file sizes: Lightning Bolt - base M15 template 10.8 MB - PNG - Fresh from Proximity with Alpha layers. RGBA 6.99 MB - PNG - Just optimized the Proximity image keeping the alpha layer 6.20 MB - PNG, no alpha, max compression

    I did this compression using Pillow in Python and had basically the same numbers from Photoshop saving the file.

    enhancement 
    opened by uolamer 0
  • Classic Template (Unreleased?)

    Classic Template (Unreleased?)

    Doesn't render lands like Ancient Tomb or Volrath's Stronghold. Editing line 118 of the XML and changing the value to "true" fixed it for me.

    opened by myojin223 0
Releases(0.6.2)
  • 0.6.1(Jan 21, 2022)

  • 0.6.0(Jan 11, 2022)

  • 0.5.4(Jan 4, 2022)

  • 0.5.3(Dec 15, 2021)

  • 0.5.2(Nov 25, 2021)

  • 0.5.1(Nov 10, 2021)

  • 0.5.0(Nov 9, 2021)

    • Local art resolution
    • Add remote resource resolution and caching
    • Fix synthetic card fields not being present on flipped sides
    • More accurate text wrapping
    • Move symbol handling to templates
    • Add plugins and scripting, which templates can use to powerful effect
    • Template content can now be broken into multiple files
    • Add noise layers, which can be used to make cards that are visually identical but cryptographically distinct
    • Arrays and string can now be sliced
    • Text scales down to try and get rid of dangling words
    • Remove ArtLayer, instead allowing ImageLayers to use URL's
    • Templates now have access to the name of the card list
    • Renames lots of elements
    • Add layer effects, which can be created by plugins and/or scripts (though be careful, scripts are slow and this will be even slower)
    • Added the following effects
      • HSB
      • Hue shift
      • Saturation shift
      • Brightness shift
      • Blur (very slow, use sparingly)
    Source code(tar.gz)
    Source code(zip)
    proximity-0.5.0.jar(37.20 MB)
  • 0.4.0(Oct 7, 2021)

    • Can now match collector numbers
    • Update all set symbols
    • Rare fetch (i.e. Prismatic Vista and Fabled Passage) lands are now gold instead of colorless
    • Added color indicators
    • Adjust typeline and card name size/locations
    • Fix a spacing issue on cards with a lot of text and flavor text
    • Replace Calibri in copyright text with Altone
    • Better logging when failing to find a card
    • Overrides can now contain full JSON values, allowing for overriding compound values (such as arrays) and for special characters (such as escaped new line characters)
    Source code(tar.gz)
    Source code(zip)
    chillis-0.4.0.zip(465.75 MB)
    proximity-0.4.0.jar(10.51 MB)
  • 0.3.0(Sep 28, 2021)

    Changes for End Users

    • Cards are now searched for individually. This means fetching card info takes longer, but allows for fuzzy search (no more exact name match necessary)
    • Blank lines in card lists are now ignored
    • Images now scale to cover their area instead of stretching
    • Overrides now work on nested elements (e.g. to change the art of a layer, you might use --override=image_uris.art_crop:https://cdna.artstation.com/p/assets/images/images/003/883/296/medium/grzegorz-rutkowski-elf-overlord-final-5-1920-logo.jpg
    • Overrides now work with quoted values
    • Set symbols! Keyrune was a great start to this, but it's not perfect, so many set symbols will need some tweaks moving forward. Please open an issue if you find any that are particularly egregious!
    • Adds an option that can be used to hide set symbols
    • For sets with missing set symbols, use the cube symbol
    • Flavor text is now separated from oracle text
    • Adds an option to hide flavor text
    • Flavor text bar is now rendered, has an option to hide

    Changes for Template Creators

    • Layer properties are elements (generally style related) that propagate down to child layers
    • Moved alignment and resizing functions from TextLayer to Layout, allow for more sophisticated spreads
    • Fix land legendary crown
    • Attribute modifiers allow templates to change attributes of layers conditionally. This is particularly useful for resizing the oracle text box depending on if the card is a creature, MDFC, or has mutate.

    Technical Changes

    Source code(tar.gz)
    Source code(zip)
    chilli.s-0.3.0.zip(465.17 MB)
    proximity-0.3.0.jar(10.51 MB)
  • 0.2.1(Sep 22, 2021)

  • 0.2.0(Sep 22, 2021)

    • Templates are now defined with XML
    • Add HorizontalLayout and VerticalLayout elements, which stagger their children horizontally and vertically, respectively
    • Added kerning option to styles
    • System fonts can now be loaded
    • Batch overrides now apply to all cards
    • Fixed a bug where batch options weren't being applied to cards
    • Add copyright info to normal template (enabled by default)
    • Add set code to normal template
    • Cardbacks are no longer generated for single faced cards
    Source code(tar.gz)
    Source code(zip)
    proximity-0.2.0.zip(467.24 MB)
  • 0.1.1(Sep 19, 2021)

  • 0.1.0(Sep 17, 2021)

    This is a first beta release! There is no UI and there may be bugs. The download includes the executable jar file and the normal template, derived from @ndepaola's Photoshop templates.

    Requires Java 16

    To run, extract the archive somewhere on your PC and open a terminal in the same folder as proximity.jar, then run the following command:

    java -jar proximity.jar --cards=YOUR_DECK_LIST --use_official_art=true --reminder_text=true --template=normal.zip
    

    The use_official_art and reminder_text options are optional, but you'll probably want them for the easiest and most accurate proxy experience.

    Notes Does not currently, and probably never will, support Planeswalkers Does not currently support split cards or Kamigawa flip cards

    Source code(tar.gz)
    Source code(zip)
    proximity-0.1.0.zip(473.24 MB)
Owner
Haven King
Haven King
Java Statistical Analysis Tool, a Java library for Machine Learning

Java Statistical Analysis Tool JSAT is a library for quickly getting started with Machine Learning problems. It is developed in my free time, and made

null 752 Dec 20, 2022
DFA来过滤敏感词工具。--- The sensitive word tool for java with DFA.

sensitive-word-plus sensitive-word-plus 基于 DFA 算法实现的高性能敏感词工具。 站在巨人肩膀上,本项目是根据sensitive-word 做的升级 创作目的 基于sensitive-word-plus 实现返回敏感词类型 实现一款好用敏感词工具。 基于 D

null 11 Sep 22, 2022
This is a tool to visualize search algorithms

Path-Finding-Visualizer Purpose This is a tool to visualize search algorithms Algorithms featured Breadth First Search Deapth First Search Gready Best

Leonard 11 Oct 20, 2022
mBERT is a mutation testing tool that uses a pre-trained language model (CodeBERT) to generate mutants.

mBERT is a mutation testing tool that uses a pre-trained language model (CodeBERT) to generate mutants.

null 7 Oct 22, 2022
MathParser - a simple but powerful open-source math tool that parses and evaluates algebraic expressions written in pure java

MathParser is a simple but powerful open-source math tool that parses and evaluates algebraic expressions written in pure java. This projec

AmirHosseinAghajari 40 Dec 24, 2022
A manager tool to categorize game assets such as images and sounds/music. The tool enables you to tag these files, so that finding them by tags allows fast searches.

BtAssetManager This application allows you to easily categorize large amounts of image and sound files. You can apply tags to each individual file to

null 21 Sep 15, 2022
🔌 Simple library to manipulate HTTP requests/responses and capture network logs made by the browser using selenium tests without using any proxies

Simple library to manipulate HTTP requests and responses, capture the network logs made by the browser using selenium tests without using any proxies

Sudharsan Selvaraj 29 Oct 23, 2022
A handy plugin for copying requests/responses directly from Burp, some extra magic included.

RIO BurpSuite plugin Request Input Output BurpSuite plugin A.K.A RIO - A handy plugin for copying requests/responses directly from Burp, some extra ma

Daniel Kalinowski 13 Nov 22, 2022
LimboFilter - Most powerful bot filtering solution for Minecraft proxies. Built with LimboAPI.

LimboFilter Most powerful bot filtering solution for Minecraft proxies. Built with LimboAPI. MC-Market SpigotMC.org Описание и обсуждение на русском я

Elytrium 80 Jan 6, 2023
Magic Bean: A very basic library which will generate POJOs.

Magic Bean: A very basic library which will generate POJOs.

Ethan McCue 48 Dec 27, 2022
Protect your Spigot server against IP forwarding exploits, as well as blocking unknown BungeeCord and/or Velocity proxies.

Sentey Protect your Spigot server against IP forwarding exploits, as well as blocking unknown BungeeCord and/or Velocity proxies. But firewalls are a

ComuGamers Network 18 Dec 28, 2022
A Minecraft plugin that adds magic spells for epic fights!

EpicSpellsPlugin EpicSpellsPlugin is a Minecraft Spigot plugin for version 1.18+ that aims to add magic spells to the game for epic pvp and pve fights

null 27 Dec 4, 2022
A template for a Forge + Fabric project setup using a Common source set.

MultiLoader Template This project provides a Gradle project template that can compile mods for both Forge and Fabric using a common sourceset. This pr

Jared 130 Jan 5, 2023
Aye - an open source tool for scanning images on Kubernetes cluster

Aye is an open source tool for scanning images on Kubernetes cluster. It uses Anchore CLI behind the scenes to get information about all images that are currently on the cluster. It also provides Prometheus metrics for each image, so teams are aware of different levels of vulnerabilities found inside them.

null 4 Sep 4, 2022
A command-line tool to generate different types of noise as images.

noisegen A command-line tool to generate different types of noise as images. Usage Run one of the releases, either the JAR using java -jar noisegen-0.

Tommy Ettinger 6 Jul 21, 2022
A tool generating local images based on ECharts-Java

Test plan Local unit testing Docker AWS remote Linux Windows MacOS Integration Test with Snapshot version Introduction This library is used to take sn

ECharts Java Open Source Project 5 Dec 16, 2022
Te4j (Template Engine For Java) - Fastest and easy template engine

Te4j About the project Te4j (Template Engine For Java) - Fastest and easy template engine Pros Extremely fast (127k renders per second on 4790K) Easy

Lero4ka16 19 Nov 11, 2022
A tool that can calculate the average solution set for a first guess in the game of Wordle

word-distances A tool that can calculate the average solution set for a first guess in the game of Wordle. Yes, the name isn't great -- I initially ha

null 1 May 2, 2022
Roman Beskrovnyi 250 Jan 9, 2023