Compressors are machines, which increase the pressure of a gas through input of mechanical work. Gas compressors and pumps for liquid are generally called working machines, see Table 2.1. Increasing gas pressure results in simultaneous increase of density and temperature.
Table 2.1: Comparison between thermal and hydraulic machines
The quantitative relationship of the parameters of the gas (pressure, temperature and density or specific volume) and its energies (e.g. work and heat) are given by the laws of thermodynamics. The minimum amount of work is needed with a compression at constant temperatures (isothermal compression), which cannot be achieved in reality.
In order to come close to isothermal compression, compressors are normally cooled and are built as multistage compressors with intercooling for higher pressures. The external work is applied onto the medium to be compressed either via force or via torque with a moving machine component, see Figure 2.1.
Figure 2.1: Application of external work of a piston compressor and a turbo compressor 
Alternatively, these machines work according to the volumetric principle (piston compressors) or the flow principle (turbo compressors), see Table 2.2.
Table 2.2: Comparison between the volumetric principle and the flow principle
Both types of compression have a long history and have their advantages and disadvantages. Both principles are therefore in use today and will be used in the future.