Skip to content

Using the Mini Maker

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

Background

The Mini Maker (a.k.a. the file mini_maker.py) is a command-line tool for "manually" creating images, such as title cards, show summaries, genre cards, or season posters.

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 PREFERENCE_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%]
                     [--genre-card SOURCE GENRE DESTINATION] [--borderless] [--genre-card-batch SOURCE_DIRECTORY]
                     [--show-summary IMAGE_DIRECTORY LOGO] [--background-color COLOR]

Manually make cards

optional arguments:
  -h, --help            show this help message and exit
  -p PREFERENCE_FILE, --preference-file PREFERENCE_FILE
                        Preference YAML file for parsing ImageMagick/Sonarr/TMDb options

Title Cards:     
  Manual TitleCardMaker interaction                      

  --card-type TYPE      Create a title card of a specific type
  --title-card SOURCE DESTINATION                                                                                       
                        Create a title card with the given source image, written to the given destination
  --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)

Genre Cards:
  Manual genre card creation

  --genre-card SOURCE GENRE DESTINATION
                        Create a genre card with the given text
  --borderless          Make the specified Genre Card transparent
  --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 ShowSummary for the given directory
  --background-color COLOR
                        Specify background color for the created ShowSummary

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 #HEX
                        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).

Manual Title Card Creation

The fixer 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.

Genre Cards

Genre cards are images that can (currently) only be created by the fixer, and are intended as collection posters for either manual use or with Plex Meta Manager. An example of a genre card, as created by the fixer, 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 season poster

Clone this wiki locally