We have implemented an extended depth of field optical system by wavefront coding with a micromachined membrane deformable mirror. This approach provides a versatile extension to standard wavefront coding based on fixed phase mask. First experimental results validate the feasibility of the use of adaptive optics for variable depth wavefront coding in imaging optical systems. © 2015 SPIE.