Crystallization is the formation of crystals, used particularly to purify a material or extract it from solution. It is used extensively in sugar processes, and also in the processing of butter and margarines, chocolate and ice cream, where crystal size decides texture: fine, uniform crystals give smooth fondant and creamy ice cream, while large crystals make grainy, coarse products. The same principle is used to prepare proteins, including enzymes, for structural analysis by X-ray diffraction. Processors steer crystallization through supersaturation, temperature, agitation and seeding to obtain the crystal habit that delivers the desired quality.