Masks are used in Metashape to specify the areas on the photos which can otherwise be confusing to the program or lead to incorrect reconstruction results. Workflow can be used in Professional and Standard versions.


Editing masks


Recommended masking all irrelevant elements on the source photos (background, accidental foreground, etc.). Masks in Metashape are represented by contours bounding certain image regions. Modification of the current mask is performed in Photo View through adding or subtracting selections.


In Metashape, the area that will not be taken into account during processing is masked. That is, if you want the background not to be used around the object, then you need to mask the background, and not create a mask for the object.



1. To switch to the Photo View double-click on the corresponding photo in the Workspace or Photo pane. 




2. To create a selection using one of the supported Selection tools (available from the Toolbar or Photo menu). In the project, we selected an object using the Intelligent Scissors:



When using Intelligent Scissors, it is possible to automatically create vertices along the border of an object, for this you need to hold down the Ctrls key and guide along the border of the object, to add them, you need to click with the left mouse button. To complete the selection of an object, press ESC. 

When using a Magic Wand, use Ctrl and Shift respectively to add and remove areas. To reset mask selection on the current photo press Esc key.

To undo a previously drawn vertex at the moment of drawing, use Ctrl+Z. 



3. The selection wouldn't be incorporated in the current mask until it is merged with the mask using Add selection, Subtract selection, Invert selection buttons from the Toolbar:


To display the mask in Model view click Show mask on the Toolbar:



If some part of the model was accidentally masked, then to remove the mask from this area, you also need to use the selection tools to create an area around the desired element and click Subtract selection button on the Toolbar:



The mask display color can be changed in the Metashape Preferences dialog window. Select Tools > Preferences... and open Appearance tab > Photo View:


To see which image masks are created, you can also click on the Show mask in the Photo pane:




Masked areas could be ignored at Align Photos processing stage (set Apply masks to option in Align Photos dialog) and are always ignored at Build Model and Build Texture stages.


Saving masks


The created mask can be also saved for external editing or storage.


1. Select Export Masks... command from the File menu (File > Export > Export Masks...).


2. In the Export Mask dialog select suitable parameters. Click OK button when done.

File type - specifies the type of generated files:

  • Single channel mask image - generates single channel black and white mask images
  • Image with alpha channel - generates color images from source photos combined with mask data in alpha channel

Filename template - specifies the file name template used to generate mask file names. This template can contain special tokens, that will be substituted by corresponding data for each photo being processed. The following tokens are supported:

    {filename} - file name of the source photo without extension

    {fileext} - extension of the source photo

    {camera} - camera label

    {frame} - frame number

    {filenum} - sequential number of the mask being exported


3. Browse to the folder where the masks should be saved and select it.


4. The progress dialog box will appear displaying the current processing status. To cancel processing click Cancel button. 


When importing/exporting mask for the current photo only, Metashape will prompt for the actual image instead of image folder. Mask file names parameter will not be used in this case. 


Loading masks


Masks can be loaded from external sources, as well as generated automatically from background images if such data is available. Metashape supports loading masks from the following sources:

  • from alpha channel of the source photos;
  • from separate images;
  • generated from background photos based on background difference technique ;
  • based on reconstructed 3D model.


1. Select Import Masks... command from the File menu (File > Import Masks...).


2. In the Import Mask dialog select suitable parameters. Click OK button when done.


Method - specifies the source of the mask data. 


Operation - specifies the action to be done in case a second mask is imported for the photo.


Filename template - specifies the file name template used to generate mask file names. This template can contain special tokens, that will be substituted by corresponding data for each photo being processed. The following tokens are supported:

  • {filename} - file name of the source photo without extension.
  • {fileext} - extension of the source photo.
  • {camera} - camera label.
  • {frame} - frame number.
  • {filenum} - sequential number of the mask being imported


Tolerance (from Background method only) - specifies the tolerance threshold used for background differencing. Tolerance value should be set according to the color separation between foreground and background pixels. For large separation higher tolerance values can be used.


3. When generating masks from separate or background images, the folder selection dialog will appear. Browse to the folder containing corresponding images and select it. 


4. The progress dialog box will appear displaying the current processing status. To cancel processing click Cancel button.