Many image and signal processing problems benefit from quaternion based models, due to their property of processing different features simultaneously. Recently the quaternion algebra model has been combined with the dictionary learning and sparse representation models. This led to solving versatile optimization problems over the quaternion algebra. Since the quaternions form a noncommutative algebra, calculation of the gradient of the quaternion objective function is usually fairly complex. This paper aims to present a generalization of the augmented directional method of multipliers over the quaternion algebra, while employing the results from the recently introduced generalized HR (GHR) calculus. Furthermore, we consider the convex optimization problems of real functions of quaternion variable.