Filament-wound composite pressure vessels, owing to the advantages of their high specific strength, specific modulus and fatigue resistance, as well as excellent design performance, have been widely used in energy engineering, chemical industry and other fields. A filament-wound composite pressure vessel generally consists of two parts, a cylindrical drum part and the dome parts. In the cylindrical drum part, the filament winding angle and the winding layer thickness can be easily determined due to the regular shape. In the dome parts, however, both the winding angle and the thickness vary along the meridian line. Performance of the dome parts, which strongly depends on the effect of end-opening and the winding mode, dominates the performance of a pressure vessel. In this paper, optimum design of the dome parts is studied by considering both geodesic winding and non-geodesic winding patterns. A hyperelliptic function is adopted as the basis function for describing the meridian of the dome shape. The dome contour is optimized by taking the shape factor (S.F.) as the objective and parameters in the basis function as the design variables. A specific composite pressure vessel is taken as the numerical analysis example with varying dome shape which is to be optimized. The optimum design solution is obtained through the particle swarm optimization algorithm. It shows that an optimized dome with non-geodesic winding has better S.F. as compared with geodesic winding. Influences of the slippage coefficient and the polar opening on the S.F. are also discussed.