PROCESSIMAGES Procedure
Example 12.6 Threshold an Image
(View the complete code for this example.)
This example shows how to use the PROCESSIMAGES procedure to set a threshold for the pixel values of an image.
The following statements process the image in the mylib.input_image table. You use the THRESHOLD statement to convert the pixel values that are below 80 to black pixels (thresholding to zero) by using the adaptive Gaussian method. The processed image is stored in the mylib.output_image table.
proc processimages data=mylib.input_image;
threshold method=adaptive_gaussian type=to_zero value=80;
output out=mylib.output_image;
run;
Output 12.6.1 shows the original image, and Output 12.6.2 shows the processed image.
Output 12.6.1: Original Image

Output 12.6.2: Processed Image

Last updated: March 26, 2026