Custom Card Types
Background
The TitleCardMaker has been designed to permit the creation of any style/type of Title Card, and the card type can then be specified globally or per-show. How to specify the global card type is described here.
In addition to customizing individual parts of a Title Card like the text, styling, and font, TitleCardMaker is designed to support multiple different types of Title Cards. These different types vary in more fundamental ways such as layout, text placement, and additional features.
There are three different types of card types:
- Built-in
-
Card types developed by yours truly and shipped as part of TitleCardMaker. These types are typically the most thoroughly tested and support all the features of TitleCardMaker.
- User-made
-
Cards developed by users of TCM who have taken the effort to make these available for others. These cards are not officially maintained, and so are not guaranteed to support all features. These are downloaded while TCM is running from the card types repository.
- Local
-
Cards as Python files that exist on your local machine and are only available to yourself. These are read and loaded dynamically when TCM launches (and periodically after that). These can be used to test cards as they are being developed, but do require a little but of Python knowledge.
These are all specified via the card_type
attribute for a specific series,
library, template, or globally. An example of each is shown below.
Example
Built-in Types
TitleCardMaker currently has the following built-in card types:
Card Type | card_type Value |
Preview |
---|---|---|
Anime | anime |
|
Banner | banner |
|
Calligraphy | calligraphy |
|
Comic Book | comic book |
|
Cutout | cutout or phendrena |
|
Divider | divider |
|
Fade | fade or 4x3 |
|
Formula 1 | formula 1 or f1 |
|
Frame | frame or photo |
|
Graph | graph |
|
Inset | inset |
|
Landscape | landscape |
|
Logo | logo or reality tv |
|
Marvel | marvel |
|
Music | music or spotify |
|
Notification | notification |
|
Olivier | olivier or ishalioh |
|
Overline | overline |
|
Poster | poster or gundam |
|
Roman Numeral | roman or roman numeral |
|
Shape | shape |
|
Standard | standard , generic , or polymath |
|
Star Wars | star wars |
|
Striped | striped |
|
Textless | textless |
|
Tinted Frame | tinted frame or blurred border |
|
Tinted Glass | tinted glass or sherlock |
|
White Border | white border or musikmann |
User-Submitted Types
There is a companion repository for user-submitted custom card types, located here. TCM allows for these types to be specified anywhere, and then downloaded and used at runtime.
Below is a showcase of all the user-submitted types available:
Local Cards
Whether for development of a custom card type, or just for your own personal use, a local file can also be used as a series/library card type. This is done by specifying the filepath to the card, such as:
Note
The creation of custom cards types does require a moderate level of technical/programming know-how
For those with at least a basic understanding of - or willingness to learn - Python and ImageMagick, creating new types of cards is quite simple. The process can be simplified to the following:
-
Identify the look of the desired card - this is less programming and more graphic design.
-
If you're playing around with ideas, I recommend getting a basic outline completed in a GUI-based editing program (so not ImageMagick) such as Photopea, Photoshop, GIMP, etc., as the visual feedback is immediate and less tedious than making small adjustments in ImageMagick.
-
With a basic layout finalized, identify which elements of the card you'd like customizable by each series/show. Think about such questions as:
-
Does the card's style only really work with a fixed font/color/size, or do you want to allow for customization?
-
If there are season titles on the image, do you use custom season titles?
-
What "data" does the card use? For example, all title cards probably use the episode title itself, but does your design also use the show title? Or perhaps the air-date?
-
Develop the set of ImageMagick commands necessary for creating your title card. This can involve a lot of searching "how to...", but looking through existing card classes might help.
-
Try and create the cards in steps (that will eventually become methods in the
CardType
class) such as "resize the source image" then "add _ overlay" and finally "add some title text" -
I usually have a "reference" card created in a GUI-editor that I am pull up alongside my "working" card created by ImageMagick, viewing them side-by-side can help make the minor text size and positioning modifications a lot easier.
-
Create the Python class that implements these identified features. This class must be a subclass of
CardType
, and as such must implement the properties and methods described in that class: -
TITLE_CHARACTERISTICS
: Dictionary with keysmax_line_width
,max_line_count
, andtop_heavy
ARCHIVE_NAME
: String to append to all archives associated with this typeTITLE_FONT
: String that is the default font to use for episode title textTITLE_COLOR
: String that is the ImageMagick color to use for episode title textFONT_REPLACEMENTS
: Dictionary of characters to substitute if the default font is usedUSES_SEASON_TITLE
: Whether season titles are used in this title cardis_custom_font()
: Method to determine whether a custom font has been usedis_custom_season_titles()
: Method to determine whether custom season titles/text has been used-
create()
: Method for creating the title card object defined by the class -
Make the modifications outlined on the companion repository here.
-
Follow the contribution process described here.