We report a direct photopatterning method to produce patterns of thin films containing nanometer-sized pores. A photoacid generator (PAG) was used as a photosensitive agent to initiate the cross-linking reaction of poly(methylsilsesquioxane) (PMSSQ) while an amphiphilic polymeric nanoparticle templates porous structure. Deep UV exposure on the films of PMSSQ/nanoparticle mixtures through a photolithographic mask and subsequent solvent rinsing give well-defined hybrid patterns where the polymeric nanoparticles are entrapped in the cross-linked PMSSQ matrix. The porous structure was generated by subsequent heating the hybrid patterns above the thermal decomposition temperature of the polymeric nanoparticle. Patterns of nanoporous film with controlled hydrophilicity were obtained by a simple UV/ozone treatment which mitigates the intrinsic hydrophobicity of the PMSSQ matrix. The patterned nanoporous films could find a variety of potential applications ranging from ultralow dielectric constant (ULK) materials...