The transition of a substance directly from the solid phase to the vapour phase, or in reverse, without going through the liquid phase.