Custom Card Types - CollinHeist/TitleCardMaker GitHub Wiki

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.

Card Types

There are three ways of using a type of card within the Maker. The built-in types (created by me), user-submitted types (created by.. users), and local files (presumably created by yourself!).

These are all specified via the card_type attribute for a specific series, library, or globally, and an example of each is shown below:

card_type: anime                   # Built-in type
card_type: Wdvh/WhiteTextAbsolute  # User-created type
card_type: /path/to/card.py        # Local file

Built-in Types

Below is the table of the card_type identifiers and their corresponding types/styles:

Card Type card_type Identifier Example
Anime anime
Banner banner
Calligraphy calligraphy
Comic Book comic book
Cutout cutout or phendrena
Divider divider
Fade fade or 4x3
Frame frame or photo
Inset inset
Landscape landscape
Logo logo or reality tv
Marvel marvel
Olivier olivier or ishalioh
Overline overline
Poster poster or gundam
Roman Numeral roman or roman numeral
Standard standard, generic, or polymath
Shape shape
Star Wars star wars
Textless textless or import
Tinted Frame tinted frame or blurred border
Tinted Glass tinted glass or sherlock
White Border white border or musikmann

User-Submitted Custom Card Types

There is a companion repository for user-submitted custom CardTypes, located here. The Maker 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:

Creator card_type Specification Example
azuravian azuravian/TitleColorMatch
Beedman Beedman/GradientLogoTitleCard
KHthe8th KHthe8th/TintedFramePlusTitleCard
lyonza lyonza/WhiteTextBroadcast
Wdvh Wdvh/StarWarsTitleOnly
Wdvh Wdvh/WhiteTextStandard
Wdvh Wdvh/WhiteTextAbsolute
Wdvh Wdvh/WhiteTextTitleOnly
Yozora Yozora/RetroTitleCard
Yozora Yozora/SlimTitleCard

Local Card Types

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:

card_type: ./card_types/TestingCardType.py

Creating a Custom Card Type

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:

  1. 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.
  2. 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?
  3. 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.
  4. 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 keys max_line_width, max_line_count, and top_heavy
    • ARCHIVE_NAME: String to append to all archives associated with this type
    • TITLE_FONT: String that is the default font to use for episode title text
    • TITLE_COLOR: String that is the ImageMagick color to use for episode title text
    • FONT_REPLACEMENTS: Dictionary of characters to substitute if the default font is used
    • USES_SEASON_TITLE: Whether season titles are used in this title card
    • is_custom_font(): Method to determine whether a custom font has been used
    • is_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
  5. Make the modifications outlined on the companion repository here.
  6. Follow the contribution process described here.