-
-
Notifications
You must be signed in to change notification settings - Fork 23
Using the Mini Maker
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 | |
Aspect Ratio Correction | |
Collection Poster | |
Genre Card | |
Movie Poster | |
Show Summary | |
Season Poster |
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
Specify the preference file to read for any related fix commands (notably ImageMagick).
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.
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"
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.
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"
Apply a blur modifier to the provided source image. See here for more details on this effect.
Apply a grayscale modifier to the provided source image. See here for more details on this effect.
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"
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"
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"
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).
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.
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.
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.
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.
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.
How much to scale the kerning for letters of title text. If unspecified, no scaling (100%
) is used.
How much to scale the stroke width for title text. If unspecified, no scaling (100%
) is used.
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.
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"
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.
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 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.
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.
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).
Specify a custom font file for the collection title text (i.e. does not change the font of COLLECTION
). If
Font color to use for the created collection poster's title text (i.e. does not affect the word COLLECTION
).
Font size to use for the created collection poster's title text (i.e. does not affect the word COLLECTION
).
Whether to omit the word COLLECTION
from the created collection poster.
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:
Do not apply the gradient overlay to the created collection poster
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:
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
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
).
Do not apply the gradient overlay to the created genre card.
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
).
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.
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
|
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
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.
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.
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.
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:
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:
Custom font file to use for the title (and subtitle) text on the created movie poster.
Custom font color to use for the title (and subtitle) text on the created movie poster.
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.
Add a drop shadow to the title text on the created movie poster.
Remove the white border and gradient from the created movie poster.
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
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.
Custom text (name/username) to use for the created ShowSummary. This is documented in greater detail here.
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 |
All season poster options follow the customization options present here.
Create a season poster. The first argument is the input poster image, and the second is the file to write the season poster to.
Logo file to add to the created season poster. The placement of this can be adjusted with --top-placement
.
Season text to add to the created season poster.
Font file to use for the created season poster.
Font color to use for the created season poster.
Font size to use for the created season poster.
Font kerning to use for the created season poster.
Where to place the logo on the created season poster. This can be top
, middle
, or bottom
.
Where to place the text on the created season poster. This can be top
or bottom
.
Do not apply the gradient overlay to the created season poster.