Variational methods have had great success to solve many problems in computer vision and image processing. They can be divided into two fundamentally different classes: convex and non-convex problems. The obvious advantage of convex problems is that the allow to compute a global minimum. This means that the quality of the solution solely depends on the accuracy of the variational model. On the other hand, for non-convex problems, the quality of the solution is subject to both the model and the optimization algorithm, since in general only a local minimizer can be computed. The goal of this tutorial is therefore firstly to give a gentle introduction into convex optimization. Secondly, we discuss recent applications of convex optimization to computer vision and image processing problems. We will cover modern techniques such as convex relaxation techniques, primal-dual optimization schemes and real-time capable implementations on the GPU.