Mirror (Data Management)

Summary

Reorients the raster by turning it over, from left to right, along the vertical axis through the center of the raster.

Illustration

Mirror illustration

Usage

  • This tool flips the raster from left to right along the vertical axis through the center of the region.

  • You can save the output to BIL, BIP, BMP, BSQ, DAT, Esri Grid, GIF, IMG, JPEG, JPEG 2000, PNG, TIFF, MRF, or CRF format, or any geodatabase raster dataset.

  • When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, or a geodatabase, you can specify a Compression Type value and a Compression Quality value in the geoprocessing environments.

Parameters

LabelExplanationData Type
Input Raster

The input raster dataset.

Mosaic Layer; Raster Layer
Output Raster Dataset

The output raster dataset.

When storing the raster dataset in a file format, specify the file extension as follows:

  • .bilEsri BIL
  • .bipEsri BIP
  • .bmp—BMP
  • .bsqEsri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • .mrf—MRF
  • .crf—CRF
  • No extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, a TIFF format file, or a geodatabase, you can specify Compression Type and Compression Quality values in the geoprocessing environments.

Raster Dataset

arcpy.management.Mirror(in_raster, out_raster)
NameExplanationData Type
in_raster

The input raster dataset.

Mosaic Layer; Raster Layer
out_raster

The output raster dataset.

When storing the raster dataset in a file format, specify the file extension as follows:

  • .bilEsri BIL
  • .bipEsri BIP
  • .bmp—BMP
  • .bsqEsri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • .mrf—MRF
  • .crf—CRF
  • No extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, a TIFF format file, or a geodatabase, you can specify Compression Type and Compression Quality values in the geoprocessing environments.

Raster Dataset

Code sample

Mirror example 1 (Python window)

This is a Python sample for the Mirror tool.

import arcpy
arcpy.Mirror_management("c:/data/image.tif", "c:/data/mirror.tif")
Mirror example 2 (stand-alone script)

This is a Python script sample for the Mirror tool.

##====================================
##Mirror
##Usage: Mirror_management in_raster out_raster
    
import arcpy

arcpy.env.workspace = r"C:/Workspace"

##Mirror a TIFF format image
arcpy.Mirror_management("image.tif", "mirror.tif")

Related topics