The process by which coloring is added to fabrics by means of dyestuffs is called dyeing. Dyeing may be done in one of three ways: (1) by immersing loose raw material, such as unspun cotton threads, in the coloring solution; (2) by immersing yarn before it is woven; and (3) by immersing the woven cloth itself. The latter method is the cheapest and the one most commonly used.

Dyestuffs are obtained from animals, vegetable substances, minerals, and organic materials. Examples of the dyes obtained from these four classes of materials are furnished by cochineal coloring matter, indigo, Prussian blue, and aniline dyes respectively.

Fibers of animal origin, such as silk or wool, can be dyed by simply immersing them in the color solution, but materials such as linen and cotton, which have a vegetable origin, will not hold some dyestuffs. Therefore, in the case of these latter fabrics it is often necessary to apply to the cloth or to the coloring solution some chemical salt, such as alum, in order to make the dyestuff adhere to the material. The chemical salt applied for this purpose is called a mordant.