Use Pixel Purity Index (PPI) to find the most spectrally pure (extreme) pixels in multispectral and hyperspectral images. These typically correspond to mixing endmembers. The PPI is computed by repeatedly projecting n-D scatter plots on a random unit vector. ENVI records the extreme pixels in each projection (those pixels that fall onto the ends of the unit vector) and it notes the total number of times each pixel is marked as extreme. A Pixel Purity Image is created where each pixel value corresponds to the number of times that pixel was recorded as extreme.

The PPI function can create a new output band or continue its iterations and add the results to an existing output band. The PPI is typically run on an MNF transform result, excluding the noise bands. The results of the PPI are typically used as input into the n-Dimensional Visualizer.See the following for details:

  • Pixel Purity Index (PPI) New Output Band: Use this option the first time you run the PPI on an image. ENVI creates an output band containing the number of times each pixel was found to be extreme (pure). You can use this as input into the n-Dimensional Visualizer.

You can also write a script to create a PPI image using the PixelPurityIndex task.

See Spectral Hourglass Workflow for instructions on the ENVI hourglass processing flow, including the PPI, to find and map image spectral endmembers from hyperspectral or multispectral data.

Pixel Purity Index (PPI) New Output Band


  1. From the Toolbox, select Spectral > Pixel Purity Index (PPI) New Output Band. The Fast Pixel Purity Index Input Data File dialog appears.
  2. Select the input file and perform optional spatial and spectral subsetting, and/or masking, then click OK. A spectrally subsetted MNF is recommended. The Fast Pixel Purity Index Parameters dialog appears
  3. Enter the Number of Iterations value. The maximum number of iterations is 32,767. With more iterations, ENVI does a better job of finding the extreme pixels. Balance the number of iterations against the time available, as each iteration can take some time depending on the CPU and system load. Typically, thousands of iterations are required for imaging hyperspectral data. The resulting image header file will list the number of iterations run.
  4. Enter a Threshold Factor value in data units for extreme pixel selection.

    For example, a value of 2 flags all pixels greater than two DN values from the extreme pixels (both high and low) as extreme. This threshold selects the pixels on the ends of the projected vector. The threshold should be approximately two to three times the noise level in the data. Landsat TM data, for example, typically have less than 1 DN of noise, so a threshold value of 2 or 3 works well. When using MNF data, which normalizes the noise, a DN is equivalent to one sigma, so a threshold value of 2 or 3 works well. Larger thresholds cause the PPI to find more extreme pixels, but they are less likely to be pure endmembers.

  5. Use the X Resize Factor and Y Resize Factor fields to subsample the data and help fit it into memory. Enter values less than 1 in both fields. For example, a resize factor of 0.5 uses every other pixel. However, you should not subsample less than 0.25 (every fourth pixel) because extreme pixels may be discarded.

  6. Choose whether to output the result to File or Memory.
  7. If you are outputting the result to a file, specify a location and filename in the Enter Output Filename field.
  8. Click OK. A dialog appears that indicates the amount of memory needed and prompts you to continue if that amount of memory is acceptable.
  9. A processing status dialog appears with the PPI plot. This plot shows the total number of extreme pixels satisfying the threshold criterion found by the PPI processing as a function of the number of iterations. It should asymptotically approach a flat line (zero slope) when all of the extreme pixels are found. ENVI adds the resulting output to the Layer Manager.

Pixel Purity Index (PPI) Existing Output Band


  1. From the Toolbox, select Spectral > Pixel Purity Index (PPI) Existing Output Band. The Fast Pixel Purity Index Input Data File dialog appears.
  2. Select the input file and perform optional spatial and spectral subsetting, and/or masking, then click OK. A spectrally subsetted MNF is recommended. The Fast Pixel Purity Index Previous Result dialog appears
  3. Enter the Number of Iterations value. The maximum number of iterations is 32,767. With more iterations, ENVI does a better job of finding the extreme pixels. Balance the number of iterations against the time available, as each iteration can take some time depending on the CPU and system load. Typically, thousands of iterations are required for imaging hyperspectral data. The resulting image header file will list the number of iterations run.
  4. Enter a Threshold Factor value in data units for extreme pixel selection.

    For example, a value of 2 flags all pixels greater than two DN values from the extreme pixels (both high and low) as extreme. This threshold selects the pixels on the ends of the projected vector. The threshold should be approximately two to three times the noise level in the data. Landsat TM data, for example, typically have less than 1 DN of noise, so a threshold value of 2 or 3 works well. When using MNF data, which normalizes the noise, a DN is equivalent to one sigma, so a threshold value of 2 or 3 works well. Larger thresholds cause the PPI to find more extreme pixels, but they are less likely to be pure endmembers.

  5. Use the X Resize Factor and Y Resize Factor fields to subsample the data and help fit it into memory. Enter values less than 1 in both fields. For example, a resize factor of 0.5 uses every other pixel. However, you should not subsample less than 0.25 (every fourth pixel) because extreme pixels may be discarded.

  6. Click OK. A dialog appears that indicates the amount of memory needed and prompts you to continue if that amount of memory is acceptable.
  7. A processing status dialog appears with the PPI plot. This plot shows the total number of extreme pixels satisfying the threshold criterion found by the PPI processing as a function of the number of iterations. It should asymptotically approach a flat line (zero slope) when all of the extreme pixels are found. ENVI adds the resulting output to the Layer Manager.