NOVELTY - Modifying (M1) at least one property of polyimide membrane involves exposing the polyimide membrane to a surface modification compound in vapor phase, where the surface modification compound has at least one amine group.    USE - For modifying at least one property of polyimide membrane, particularly hollow fiber polyimide membrane; for separating at least one fluid or particle from a mixture; and for separating carbon dioxide from gas mixture comprising carbon dioxide and at least one of methane and hydrogen (claimed). The polyimide membrane is used for hydrogen purification in syngas production; and is used to separate oxygen from air.    ADVANTAGE - The method is improved method for producing membranes that maintain their structural integrity and have excellent gas selectivity. By using the vapor-phase modification of polyimide membranes the present method does not results in methanol swelling of the polyimide membrane, as compared to prior art method which utilizes solution modification approach (i.e. methanol as a solvent for the cross-linking compound). The vapor-phase modifications are mainly surface modifications; the modifications do not undermine the integrity of the polyimide membrane structure itself and thus more suitable for very thin membranes such as hollow fiber membranes. The pore size of the hollow fiber does not change during the exposing step. As diamine vapors are used in the present method, the diamine solution is reused, by making vapor-phase modification an economical choice when compared to the prior art solution modification approach.    DETAILED DESCRIPTION - INDEPENDENT CLAIMS are included for the following:    (1) separating at least one fluid or particle from a mixture involving contacting the mixture with one side of a membrane made in the method (M1), and applying a pressure to the one side of the membrane to cause the fluid or particle to permeate the membrane; and    (2) separating carbon dioxide from gas mixture comprising carbon dioxide and at least one of methane and hydrogen, involving contacting the gas mixture with one side of a membrane made in the method (M1), and applying a pressure to the gas mixture in contact with the treated polyimide membrane to cause at least a portion of the carbon dioxide present in the gas mixture to permeate the treated polyimide membrane.