We study magnetic field penetration into a thin film made of a superconducting niobium. Imaging of magnetic field is performed by optically detecting magnetic resonances of negatively charged nitrogen-vacancy defects inside a single crystal diamond, which is attached to the niobium film under study. The experimental results are compared with theoretical predictions based on the critical state model, and good agreement is obtained.