Using the canonical JSJ splitting, we describe the outer automorphism group Out(G) of a one-ended word hyperbolic group G. In particular, we discuss to what extent Out(G) is virtually a direct product of mapping class groups and a free abelian group, and we determine for which groups Out(G) is infinite. We also show that there are only finitely many conjugacy classes of torsion elements in Out(G), for G any torsion-free hyperbolic group. More generally, let Γ be a finite graph of groups decomposition of an arbitrary group G such that edge groups G e are rigid (i.e. Out(G e ) is finite). We describe the group of automorphisms of G preserving Γ, by comparing it to direct products of suitably defined mapping class groups of vertex groups.