Skip to content

Using the Mini Maker

Collin Heist edited this page Dec 28, 2023 · 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
Aspect Ratio Correction Example Aspect Ratio Correction
Collection Poster Example Collection Poster
Genre Card Example Genre Card
Movie Poster Example Movie Poster
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] [--borderless] [--no-gradient] [--title-card SOURCE DESTINATION]
                     [--card-type TYPE] [--blur] [--grayscale] [--episode EPISODE_TEXT] [--season SEASON_TEXT]
                     [--title TITLE_LINE [TITLE_LINE ...]] [--font-file FONT_FILE] [--font-size SCALE%]               
                     [--font-color #HEX] [--font-vertical-shift PIXELS] [--font-interline-spacing PIXELS]
                     [--font-kerning SCALE%] [--font-stroke-width SCALE%] [--ratio SOURCE DESTINATION]                
                     [--ratio-batch DIRECTORY] [--ratio-style {copy,stretch}]                                         
                     [--collection-poster SOURCE DESTINATION] [--collection-title TITLE_LINE [TITLE_LINE ...]]        
                     [--collection-font FONT] [--collection-font-color COLOR] [--collection-font-size SCALE%]         
                     [--omit-collection] [--movie-poster SOURCE DESTINATION]                                          
                     [--movie-title TITLE_LINE [TITLE_LINE ...]] [--movie-top-subtitle TOP_SUBTITLE]
                     [--movie-subtitle SUBTITLE] [--movie-index INDEX] [--movie-logo LOGO_FILE] [--movie-font FONT]   
                     [--movie-font-color COLOR] [--movie-font-size SCALE%] [--genre-card SOURCE GENRE DESTINATION]
                     [--genre-card-batch SOURCE_DIRECTORY] [--show-summary IMAGE_DIRECTORY LOGO]
                     [--background COLOR_OR_IMAGE] [--created-by CREATOR] [--summary-type SUMMARY_TYPE]
                     [--season-poster SOURCE DESTINATION] [--season-poster-logo LOGO] [--season-text SEASON_TEXT]
                     [--season-font FONT_FILE] [--season-font-color COLOR] [--season-font-size SCALE%]
                     [--season-font-kerning SCALE%] [--top-placement]

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 "{...}/preferences.yml"
  --borderless, --omit-border
                        Omit the border from the created Collection/Genre image
  --no-gradient, --omit-gradient
                        Omit the gradient from the created Collection/Genre/Season image

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                                                     
  --grayscale           Convert the source image to grayscale 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  
  --logo LOGO_FILE      Logo file to add to the card (if supported)                                                           
  --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)
 
Aspect Ratio Correction:                                                                                        
  Fit images into a 16:9 aspect ratio                                                                           
                                                        
  --ratio SOURCE DESTINATION, --aspect-ratio SOURCE DESTINATION
                        Correct the aspect ratio of the given image, write to destination                       
  --ratio-batch DIRECTORY, --aspect-ratio-batch DIRECTORY
                        Correct the aspect ratios of all images in the given directory
  --ratio-style {copy,stretch}, --aspect-ratio-style {copy,stretch}
                        Style of the aspect-ratio correction to utilize

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

Movie Posters:                                                                                                  
  Manual movie poster creation                                                                                  
                                                                                                                
  --movie-poster SOURCE DESTINATION                                                                             
                        Create a movie poster with the given files                                              
  --movie-title TITLE_LINE [TITLE_LINE ...]                                                                     
                        Movie title for the movie poster                                      
  --movie-top-subtitle TOP_SUBTITLE                                                                             
                        Top subtitle line for the movie poster                                                  
  --movie-subtitle SUBTITLE                                                                                     
                        Subtitle for the movie poster                                                           
  --movie-index INDEX, --movie-number INDEX                                                                     
                        Index number/text to place behind the title text on the movie poster                    
  --movie-logo LOGO_FILE                                                                                        
                        Logo file to overlay on top of movie poster                                             
  --movie-font FONT     Custom font for the title text of the movie poster               
  --movie-font-color COLOR                 
                        A custom font color for the movie poster
  --movie-font-size SCALE% 
                        A font scale (as percentage) for the movie poster
  --movie-drop-shadow   Whether to add a drop shadow to the text for the movie poster

Genre Cards:
  Manual genre card creation 

  --genre-card SOURCE GENRE DESTINATION
                        Create a genre card with the given text
  --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_OR_IMAGE
                        Specify background color or image for the created show summary
  --created-by CREATOR  Specify a custom username for the "Created by .." text on the created show summary
  --summary-type SUMMARY_TYPE
                        Summary type to create - must be "standard" or "sylized"

Season Poster:
  Manual SeasonPoster creation

  --season-poster SOURCE DESTINATION
                        Create a season poster with the given assets
  --season-poster-logo LOGO
                        Add the given logo to the created season poster
  --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) in the season poster
  --logo-placement {top,middle,bottom}
                        Where to place the logo in the created season poster
  --text-placement {top,bottom}
                        Where to place the text in the created 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.

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.

NOTE: The following command has been spaced into multiple lines (the \ characters) to improve readability; this is not required.

pipenv run python mini_maker.py \
--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

Apply a blur modifier to the provided source image. See here for more details on this effect.

--grayscale

Apply a grayscale modifier to the provided source image. See here for more details on 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"

--logo

Custom logo file to use for the Title Card, if necessary. Paths with spaces must be surrounded in quotes " "). Required for some cards (e.g. Logo), optional for others (Tinted Frame).

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


Aspect Ratio Correction

A lot of older shows were aired in 4:3 (or some other) aspect ratio, while Plex (and therefore the TitleCardMaker) utilize the "modern" aspect ratio of 16:9. This component of the mini maker can be utilized to "correct" images that are in a non-16:9 aspect ratio.

If a non-16:9 aspect ratio image is utilized as a source image of a title card, then TCM will center-crop into the image, effectively removing the left and right sides of the image.

--ratio, --aspect-ratio

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

--ratio "in image.jpg" "out image.jpg"

--ratio-batch, --aspect-ratio-batch

Specify an entire directory of images to correct the aspect ratios of. This is an alternative to --ratio, but applies the correction to every image in the given directory. The corrected files are named identically with -corrected added to their filename.

--ratio-style, --aspect-ratio-style

Style of correction to utilize. Currently there are only two styles, copy, and stretch. If unspecified, copy style is utilized. Broadly speaking, copy style copies parts of the image and "adds" them to the side; while stretch style cuts parts of the image and stretches them to the sides. An example of both is shown below:

Command Example Image
--ratio-style copy
--ratio-style stretch

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.

--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

--no-gradient, --omit-gradient

Do not apply the gradient overlay to the created 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:

pipenv run python mini_maker.py --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).

--no-gradient, --omit-gradient

Do not apply the gradient overlay to the created genre card.

--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:

pipenv run python mini_maker.py --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.


Movie Posters

Below is a table of the different title layouts for movie poster creation:

Command Example Card
--movie-title "THOR" "RAGNAROK"
--movie-title "THOR RAGNAROK"
--movie-title THOR --movie-subtitle RAGNAROK
--movie-top-subtitle THOR --movie-title RAGNAROK

--movie-poster

Create a movie poster for the given input file, and write it to the given output file. This argument takes two fields, the input file and the output file.

An example of using this argument is below:

pipenv run python mini_maker.py --movie-poster in_file.jpg out_file.jpg

--movie-title

Title lines for the created movie poster. Each field is a new line in the title, so for example:

pipenv run python mini_maker.py --movie-poster in_file.jpg out_file.jpg --movie-title "THOR" "RAGNAROK" 

Will put "THOR" on one line, and "RAGNAROK" on the second. If specified as --movie-title "THOR RAGNAROK" then the title will be written in one line. See this section's table for an example.

--movie-top-subtitle

Top subtitle line for the created movie poster. This subtitle will be placed above the standard title provided via --movie-title, and must be at most one line.

--movie-subtitle

Subtitle lines for the created movie poster. The subtitle is the small text beneath the standard title area, and must be at most one line.

--movie-index, --movie-number

Optional "index" number to place behind the title text. This is not very common, but can be useful for movies that are a part of a longer-running franchise.

For example, Die Hard 3, with the command --movie-title "DIE HARD" --movie-subtitle "WITH A VENGEANCE" --movie-index 3 will produce the following poster:

--movie-logo

Optional logo file to overlay on top of the movie poster.

For example, for movies produced by Marvel Studios, a Marvel Studios logo can provided to produce posters like so:

--movie-font

Custom font file to use for the title (and subtitle) text on the created movie poster.

--movie-font-color

Custom font color to use for the title (and subtitle) text on the created movie poster.

--movie-font-size

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

--movie-drop-shadow

Add a drop shadow to the title text on the created movie poster.

--borderless

Remove the white border and gradient from the created movie poster.


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 in the summary.

An example of using this argument is below:

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

--background

Color or path to an image to use for the background of the ShowSummary being created with --show-summary. An example of an image summary created with a background image as opposed to a color is shown below:

If using the stylized summary type, then the background cannot be changed to anything other thank black.

--created-by

Custom text (name/username) to use for the created ShowSummary. This is documented in greater detail here.

--summary-type

Type of summary to create. This must be either standard or stylized. The difference in the two is shown below:

Summary Type Example
standard
stylized

Season Posters

All season poster options follow the customization options present here.

--season-poster

Create a season poster. The first argument is the input poster image, and the second is the file to write the season poster to.

--season-poster-logo

Logo file to add to the created season poster. The placement of this can be adjusted with --top-placement.

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

--logo-placement

Where to place the logo on the created season poster. This can be top, middle, or bottom.

--text-placement

Where to place the text on the created season poster. This can be top or bottom.

--no-gradient, --omit-gradient

Do not apply the gradient overlay to the created season poster.


Clone this wiki locally