The sorption of compressed carbon dioxide and methane in a series of all-aromatic poly(etherimide) (PEI) thin films is presented. The polymer films are derived from the reactions between an arylether diamine (P1) and four different dianhydrides [3,3 0 ,4,4 0 -oxydiphthalic dianhydride (ODPA), 3,3 0 ,4,4 0 biphenyltetra-carboxylic dianhydride (BPDA), 3,3 0 ,4,4 0benzo-phenonetetracarboxylic dianhydride (BTDA), and pyromellitic dianhydride (PMDA)] that have been selected to systematically change the flexibility of the polymer backbone, the segmental mobility, and the nonequilibrium excess free volume (EFV) of the polymer. The EFV, gas sorption capacities, and sorption-and temperature-induced dynamic changes in film thickness and refractive index have been investigated by