In this study the ability of recording of the information needed as images during performing the researches was investigated. Also, the use of image processing in analytical chemistry for analysis of chemical compounds was considered. In this research a length of stain detector for determination of the total amount of formaldehyde in the air was exploited. Formaldehyde as an example of hazardous gases in the air were examined. First a sodium sulfite solution containing methylene blue indicator was made, and then injected into the detector during stains and a blue background on the detector is created, By injection a volume of formaldehyde solution in to the detector white spot was observed. The observed changes such as the length, area and the color intensity of the stain increases with the concentration at constant volume of the sample. For an authorized study of the detector performance all the changes from the beginning to the end of determination was recorded by a digital camera and saved. All the experimental parameters and the necessary provisions needed for designing and construction of a permanent length of stain detector for analysis of the samples out of the laboratory were studied. The optimum condition for performing rapid analysis in a repetitive manner by generation of an appropriate stain in the display part of the detector was specified positioning the camera in front the detector free the operator paying sever attention during the experiment and also performs as an appropriate method for transferring the data between the user and experts. From the recorded images using the image processing and analysis method from software such as Matlab analytical data such as the area, color intensity of the stains were extracted. The calibration curve has two linear ranges from 1×10-3 to 0.1 M and from 0.1 to 1 M with a detection limit about 3.65×10-6 M. The method was successfully applied for the determination of the formaldehyde gases in the air.