In this paper, we address the problem of generating trajectories of some image features in order to control efficiently a robotic system using an image-based control strategy. First, physically valid C2 image trajectories which correspond to quasioptimal 3D camera trajectory are performed. Both self-occlusions avoidance and visibility constraints are taken into account at the task planning level. The good behavior of Image-based control when desired and current camera positions are close is then exploited to design an efficient control scheme. Real time experimental results using a camera mounted on the end effector of a six d-o-f robot confirm the validity of our approach.