Skip to content

Automatic Matting

Jeff Godfrey edited this page Jul 22, 2021 · 16 revisions

When active, the automatic matting system will dynamically generate digital mats for your images as they are displayed (the image files themselves are not modified in any way). Each auto-generated mat will always exactly fit the display area of your frame. The contained image(s) are then scaled to fit inside the generated mat. See the end of this page for visual examples of the various matting styles.

Activating the matting system

The matting system can be activated by the configuration option mat_images. It can be set in one of three ways:

  1. False - this disables the matting system and no images will be matted.
  2. True - this enables the matting system and all images will be matted.
  3. A REAL value that controls whether a given image is matted or not. The value is a percentage (0.01 = 1%) and represents a differece between the aspect ratio of the display and the aspect ratio of the current image. If those values are different by more than the specified percentage, the image will be matted. If the difference is less than or equal to the specified percentage, the image will not be matted. This allows you to only mat images that don't closely fit the aspect ratio of your display.

Mat Styles

The available matting styles are controlled by the configuration option mat_types. The value is a single string of mat type names and can include any or all of the following:

float float_poloroid float_color_wrap single_bevel double_bevel double_flat

A value of null is equivalent to defining all mat types.

When a mat is generated for viewing, the style is randomly selected from the string of configured types. If there are types you do not want to use, simply remove them from the string. Likewise, if you only want to use a single mat type, define that as the only item in the string.

An example of each matting style is provided later in this page.

Mat Colors

The colors used in the mats are controlled by the configuration options outer_mat_color and inner_mat_color. Note, all mat styles use the outer_mat_color option, but only some styles use the inner_mat_color option.

If the outer_mat_color value is set to null, the matting system will analyze the image and automatically select a color based on the dominant colors found in the image that's being matted.

If the inner_mat_color value is set to null, the inner mat color is created as a darker version of the outer_mat_color.

To define specific colors for the outer mat or the inner mat, define these properties as an RGB list, with each component falling in the 0-255 range. For example, a solid red mat could be defined as [255, 0, 0].

Additionally, other colors used in some small details of the mats are automatically generated as variations of the chosen outer_mat_color.

Mat Borders

The minimum size of the mat borders can be set using the outer_mat_border and inner_mat_border configuration options. As with the inner_mat_color option mentioned above, only some mat styles use the inner_mat_border property. These values are in pixel units.

Mat Textures

The generated mats can use either a colorized texture or a solid-fill color. This is controlled by the outer_mat_use_texture and inner_mat_use_texture options. These are boolean values and should be set to True or False. If True, a provided texture is used for the mats. If False a simple, solid color is used instead. By default, the outer mat uses a texture and the inner mat uses a solid color.

Additional Notes

  • If the configuration option portrait_pairs is active, both images in a portrait pair will use the same mat style.
  • If the configuration option portrait_pairs is active, any automatic color selection is calculated from the left-hand image of the portrait pair.
  • The simulated lighting used to generate the mat details (highlights, shadows, bevel variations) is fixed and is assumed to come from the upper-left. That puts inner shadows on the top and left edges and outer shadows on the bottom and right edges. This might require some improvement in the future.
  • Currently, the matting system does not dynamically resize decoration widths (bevels, shadows, highlights) based on the display resolution. The decorations are designed to look as intended on a standard HD display (1920x1080). On displays with higher or lower resolution, the width of the various decorations will be narrower or wider than intended. This will likely be improved in a future release.

Mat Style Examples

While it's difficult to see the matting details in these small samples, they should provide some insight into the available styles.

The float style

Here, the original image is simply floated above a background mat.

float style

The float_polaroid style

This style is similar to the above float style, except the image is wrapped with a white, polaroid-style frame.

float polaroid style

The float_color_wrap style

This is another style based on the simple float style. However, in this case, the image is wrapped with a subtly highlighted, colorized frame.

float color wrap style

The single_bevel style

A single mat with a bevel-cut style.

single bevel style

The double_bevel style

A double mat with a bevel-cut style.

double bevel style

The double_flat style

Another double-mat style, but here the image is placed directly on top of the inner mat rather than being behind (or floated above) it.

double flat style