Most chromatic chords have diatonic origins - in other words they are diatonic chords that are used out of their usual context. The diminished seventh - with its characteristic rich sound created by a stack of three minor thirds - is the diatonic chord of vii7 in minor keys. Examples a) and b) below show a vii chord plus an added seventh and Example c) shows the same chord in the minor.
As shown in Example d), a minor vii7 - or diminished seventh chord - has the same sounding interval structure of three stacked minor thirds whatever inversion you use (although one of the intervals is a written augmented second).
if you are alarmed by all these interval names don't forget to look at the Basics section of the Toolkit
Chord vii in both major and minor often resolves onto I. This function is sometimes called dominant substitution - the diminished seventh takes over the role usually played by the dominant in a perfect cadence. Part of the reason why it can function in this way can be seen by looking again at Example a) above. Chord vii consists of the same notes as a dominant seventh (V7) but without the root of this chord.
Diminished sevenths usually resolve according to the following general rule: the two diminished fifths marked on the first example below pull inwards to a third as shown. Whatever the inversion, the notes still generally resolve according to this rule. So the F in the above example usually resolves to E regardless of the inversion. Different inversions of the diminished sevenths therefore resolve to different inversion of I when they are acting as dominant substitutes.
In the following examples, the diminished sevenths have an intensifying effect - unlike the example in longer progressions where the diminished seventh is part of a modulation.