Skip to content

Using the Mini Maker

Collin Heist edited this page Jul 24, 2022 · 29 revisions

Background

The Mini Maker (a.k.a. the file mini_maker.py) is a command-line tool for "manually" creating images. An example of each possible created image is shown below:

Image Type Example
Title Card Example Title Card
Collection Poster Example Collection Poster
Genre Card Example Genre Card
Show Summary Example Genre Card
Season Poster Example Genre Card

Runtime Options

This file's -h or --help (help) menu is shown below:

Click to Expand
# pipenv run python3 mini_maker.py --help
usage: mini_maker.py [-h] [-p FILE] [--title-card SOURCE DESTINATION] [--card-type TYPE] [--blur]
                     [--episode EPISODE_TEXT] [--season SEASON_TEXT] [--title TITLE_LINE [TITLE_LINE ...]]             
                     [--font FONT_FILE] [--font-size SCALE%] [--font-color #HEX] [--vertical-shift PIXELS]
                     [--interline-spacing PIXELS] [--kerning SCALE%] [--stroke-width SCALE%]                           
                     [--collection-poster SOURCE DESTINATION] [--collection-title TITLE_LINE [TITLE_LINE ...]]
                     [--collection-font FONT] [--collection-font-color COLOR] [--collection-font-size SCALE%]
                     [--omit-collection] [--collection-borderless] [--genre-card SOURCE GENRE DESTINATION]
                     [--borderless] [--genre-card-batch SOURCE_DIRECTORY] [--show-summary IMAGE_DIRECTORY LOGO]
                     [--background-color COLOR] [--created-by CREATOR] [--season-poster SOURCE LOGO DESTINATION]
                     [--season-text SEASON_TEXT] [--season-font FONT_FILE] [--season-font-color COLOR]
                     [--season-font-size SCALE%] [--season-font-kerning SCALE%]

Manually make cards

optional arguments:
  -h, --help            show this help message and exit
  -p FILE, --preferences FILE, --preference-file FILE
                        File to read global preferences from. Environment variable TCM_PREFERENCES. Defaults to
                        "/mnt/user/Media/TitleCardMaker/preferences.yml"

Title Cards:
  Manual TitleCardMaker interaction

  --title-card SOURCE DESTINATION
                        Create a title card with the given source image, written to the given destination
  --card-type TYPE      Create a title card of a specific type
  --blur                Blur the source image for this card 
  --episode EPISODE_TEXT
                        The episode text for this card
  --season SEASON_TEXT  The season text for this card
  --title TITLE_LINE [TITLE_LINE ...]
                        The title text for this card
  --font FONT_FILE, --font-file FONT_FILE
                        A custom font file for this card
  --font-size SCALE%, --size SCALE%
                        A font scale (as percentage) for this card
  --font-color #HEX, --color #HEX
                        A custom font color for this card
  --vertical-shift PIXELS, --shift PIXELS
                        How many pixels to vertically shift the title text
  --interline-spacing PIXELS, --spacing PIXELS
                        How many pixels to increase the interline spacing of the title text
  --kerning SCALE%      Specify the font kerning scale (as percentage)
  --stroke-width SCALE%, --stroke SCALE%
                        Specify the font black stroke scale (as percentage)

Collection Posters:
  Manual collection poster creation

  --collection-poster SOURCE DESTINATION
                        Create a collection poster with the given files
  --collection-title TITLE_LINE [TITLE_LINE ...]
                        Collection title for this collection poster
  --collection-font FONT
                        Custom font for the collection text of the specified poster
  --collection-font-color COLOR
                        A custom font color for this collection poster
  --collection-font-size SCALE%
                        A font scale (as percentage) for this collection poster
  --omit-collection     Omit the "COLLECTION" text from this collection poster
  --collection-borderless
                        Omit the white border from this collection poster

Genre Cards:
  Manual genre card creation

  --genre-card SOURCE GENRE DESTINATION
                        Create a genre card with the given text
  --borderless          Omit the white border from this genre card
  --genre-card-batch SOURCE_DIRECTORY
                        Create all genre cards for images in the given directory based on their file names

Show Summaries:
  Manual ShowSummary creation 

  --show-summary IMAGE_DIRECTORY LOGO
                        Create a show summary for the given directory
  --background-color COLOR
                        Specify background color for the created show summary
  --created-by CREATOR  Specify a custom username for the "Created by .." text on the created show sumamry

Season Poster:
  Manual SeasonPoster creation

  --season-poster SOURCE LOGO DESTINATION
                        Create a season poster with the given assets
  --season-text SEASON_TEXT
                        Season text for the created season poster
  --season-font FONT_FILE
                        A custom font file for this season poster
  --season-font-color COLOR
                        A custom font color for this season poster
  --season-font-size SCALE%
                        A font scale (as percentage) for this season poster
  --season-font-kerning SCALE%
                        Specify the font kerning scale (as percentage) for this season poster

--preference-file, -p

Specify the preference file to read for any related fix commands (notably ImageMagick).

Image Creation

Title Cards

The mini maker can be used to "manually" create title cards. This section of the fixer allows for the customization of these cards.

NOTE: A majority of the font customization arguments are explained in greater detail here.

Examples

NOTE: All the following commands have been spaced into multiple lines (the \ characters) to improve readability; this is not required.

Typical Example

The following example creates a standard title card at card.jpg using the source image at ./source/Breaking Bad (2005)/s1e1.jpg with the title and season/episode text set according to the episode.

$ pipenv run python \
--title-card "./source/Breaking Bad (2005)/s1e1.jpg" "card.jpg" \
--title "Pilot" \
--season "SEASON 1" \
--episode "EPISODE 1"

--card-type

Specify the card type of the title card to create. This must be a valid card type, or it can be a remote card type hosted on the GitHub.

--title-card

Specify the input (source) image, and destination card filename. Paths with spaces need to be surrounded in quotes (" "). An example of this option:

--title-card "in image.jpg" "out card.jpg"

--blur

Whether to blur the provided source image. See here for an example/motivaton for this effect.

--episode

The episode text to use for manual title card creation. Episode text with spaces need to be surrounded in quotes (" "). If unspecified, EPISODE is used. An example of this option:

--episode "CHAPTER 1"

--season

The season text to use for manual title card creation. Season text with spaces need to be surrounded in quotes (" "). If unspecified, no season text is used. An example of this option:

--season "SEASON 1"

--title

The title text to use for manual title card creation. Titles with spaces need to be surrounded in quotes (" "); and if the title is multiple lines, these need to be specified with spaces. An example of this option:

--title "Top Line:" "Bottom Line"

--font, --font-file

The custom font file to use for manual title card creation. Paths with spaces need to be surrounded in quotes (" "). If unspecified, the generic font for the specified card type is used.

--font-size, --size

The font size scalar to use for manual title card creation. This must be specified as SCALE% (i.e. 105%). If unspecified, no scaling (100%) is used.

--font-color, --color

The custom font color to use for manual title card creation. This must be a valid imagemagick color. If unspecified, the default font color for the specified card type is used.

--vertical-shift, --shift

How many pixels to vertically offset the title text for manual title card creation. A positive value moves the text up, negative down. If unspecified, a value of 0 is used.

--interline-spacing, --spacing

How many pixels to offset the interline spacing between lines of title text for manual title card creation. A positive value adds spacing between lines, negative decreases spacing. If unspecified, a value of 0 is used.

--kerning

How much to scale the kerning for letters of title text. If unspecified, no scaling (100%) is used.

--stroke-width

How much to scale the stroke width for title text. If unspecified, no scaling (100%) is used.


Collection Posters

Collection posters are images that can only be created with the mini maker, and are intended as collection posters for either manual use or with Plex Meta Manager.

--collection-poster

Create a collection psoter for the given source image. The first argument is the input source image, the second is the file to write the poster to.

--collection-title

Specify the collection title for the created collection poster. If unspecified, no title will be added. To specify multiple lines, separate the title with spaces - for example:

$ pipenv run python mini_maker.py --collection-poster in_file.jpg out_poster.jpg --collection-title "Batman" "& ROBIN"

Will create a file out_poster.jpg with the collection title being "BATMAN" (top line) and "& ROBIN" (bottom line).

--collection-font

Specify a custom font file for the collection title text (i.e. does not change the font of COLLECTION). If

--collection-font-color

Font color to use for the created collection poster's title text (i.e. does not affect the word COLLECTION).

--collection-font-size

Font size to use for the created collection poster's title text (i.e. does not affect the word COLLECTION).

--omit-collection

Whether to omit the word COLLECTION from the created collection poster.

--collection-borderless

Whether to create the collection poster without the white border. This can be used to create a transparent version of the poster (if the output file is specified as an image that supports transparency like png or gif).

An example of a transparent poster is shown below:

transparent collection poster

Genre Cards

Genre cards are images that can (currently) only be created by the Mini Maker, and are intended as collection posters for either manual use or with Plex Meta Manager. An example of a genre card, and how they can be showcased in Plex, are shown below:

--genre-card

Specify the input (source) image, and destination genre card filenames, as well as the genre text to use. This is specified as:

$ --genre-card in_image.jpg GENRE_TEXT out_card.jpg

--borderless

Make the created genre card borderless. This removes the white border, and allows for transparent genre cards such as:

If omitted and a transparent image is provided, a transparent image will NOT be created. A white background is used instead.

NOTE: If using to create transparent genre cards, be sure to specify an output file type that supports transparency (such as .png or .gif).

--genre-card-batch

Specify the directory of images to 'batch' create multiple genre cards at once. All image files (ending in jpg, jpeg, png, tiff, or gif) under the given directory are used. For each image, the filename is interpreted as the genre text.

For example, with the given directory:

genre_cards
├── Action.jpg
├── Adventure.gif
└── News.png

Using the following command:

$ --genre-card-batch ./genre_cards/

Will create three genre cards with text ACTION, ADVENTURE, and NEWS as text. These cards have -GenreCard added to their filenames (i.e. Action-GenreCard.jpg).

--font-size, --size

The font size scalar to use for genre text. This must be specified as SCALE% (i.e. 105%). If unspecified, no scaling (100%) is used.


Show Summaries

--show-summary

Create a ShowSummary for an arbitrary directory. The first argument is the directory to make a summary of (the Maker will search recursively for images, so images can be in any sub-directories). The second argument is the logo file to use at the top of the summary.

An example of using this argument is below:

$ pipenv run python fixer.py --show-summary ./some_directory/ logo_file.png

--background-color

Color to use for the background of the ShowSummary being created with --show-summary.


Season Posters

All season poster options follow the customization options present here.

--season-poster

Create a season poster for the given source image and logo. The first argument is the input poster image, the second the logo to use, and the third is the file to write the season poster to.

--season-text

Season text to add to the created season poster.

--season-font

Font file to use for the created season poster.

--season-font-color

Font color to use for the created season poster.

--season-font-size

Font size to use for the created season poster.

--season-font-kerning

Font kerning to use for the created season poster.


Clone this wiki locally