Classify By Aspect Ratio

 

<< Click to Display Table of Contents >>

Navigation:  Nodes > Tasks > Classifiers >

Classify By Aspect Ratio

 

 

Purpose

 

This node will classify the input media by its image aspect ratio, sending different ranges of aspect ratios trough different connectors.

 

As a difference to other metadata classifiers, this node provides a Threshold property to match images to the "most similar" aspect ratio rather than forcing to strict matching.

 

Inputs

 

files: To connect a files to be classified. You can connect a Folder or a Watcher node, for example.

 

Outputs

 

Output List of possible aspect ratios: A definable list of connectors. You can add/remove connectors by adding/removing them on the Output List property,

 

other: Input media files not matching any aspect ratio in the Output List (plus/minus a defined threshold) will be sent trough this connector

 

notFound: Input files with no resolution metadata properly defined (aspect ratio not found) will be sent trough this connector.

 

 

Standard properties

 

Object Name

Color

Lock

 

Python standard properties

 

Code

NOTE: An introduction to all the Python tools in Mistika Workflows is available in the Python scripting tools section.

 

 

Node specific properties

 

Output List: Comma separated list of aspect ratio options (decimal places accepted). By default:  0.56,1.00,1.33,1.77,1.85,2,2.35. You can modify the list to your likes, and the connectors will be refreshed immediately.

 

Threshold:  Percentage of difference permitted for aspect ratio matching.  Note that if more than one matches are possible this node will only send the media file trough the first matching connector.

 

 

Error mode:  When no matching is found, this property defines what kind of error message will be sent to the error log (None, Info, Warning, Critical). This is mainly to facilitate user scripts parsing render log files later (or human monitoring). But note that this is just a log message, the case Critical will not stop the workflow execution because this node provides its own error control branches via the other connector (when the output connectors do not cover all the possible outcomes).

 

Developer reference (Python - ClassifyByAspectRatio.[Property ID], API Rest - node/ClassifyByAspectRatio/property/[Property ID])

 

[mcp]

Note: The image aspect ratio (also known as image format or video format) is the horizontal size divided by the vertical size of the images.  But the standards are often named as reduced fractions ( for example, "16/9" is commonly used for the 1.77 aspect ratio, "4/3" is used for 1.33 and so on).  But many times the resolution division of the actual images is not an exact match of a standard (fractions like 16/9 and 4/3 are periodic containing infinite decimals, and for example in some formats it is a common practice to round to the compression block size...). So it is recommended to always set the Threshold property to a small percentage to allow for small resolution variations when filtering by aspect ratio (one percent is normally enough).  

[/mcp]

 

 

Property Label

Property ID

Output List

outputList

Threshold

threshold

Error Mode

errorMode