Noble-transition metal (noble=Pt,Au; transition=Co,Ni,Cu) alloy particles with sizes of about 5 nm have been studied by in situ high-energy x-ray diffraction while subjected to oxidizing (O 2) and reducing (H 2) gas atmospheres at elevated temperatures. The different gas atmospheres do not affect substantially the random alloy, face-centered-cubic structure type of the particles but do affect the way the metal atoms pack together. In an O 2 atmosphere, atoms get extra separated from each other, whereas, in an H 2 atmosphere, they come closer together. The effect is substantial, amounting to 0.1 Å difference in the first neighbor atomic distances, and concurs with a dramatic change of the particle catalytic properties. It is argued that such reactive gas induced "expansion shrinking" is a common phenomenon that may be employed for the engineering of "smart" nanoparticles responding advantageously to envisaged gas environments.