Curvilinear structure restoration in image processing procedures is a difficult task, which can be compounded when these structures are thin, i.e. when their smallest dimension is close to the resolution of the sensor. Many recent restoration methods involve considering a local gradient-based regularization term as prior, assuming gradient sparsity. An isotropic gradient operator is typically not suitable for thin curvilinear structures, since gradients are not sparse for these. In this article, we propose a mixed gradient operator that combines a standard gradient in the isotropic image regions, and a directional gradient in the regions where specific orientations are likely. In particular, such information can be provided by curvilinear structure detectors (e.g. RORPO or Frangi filters). Our proposed mixed gradient operator, that can be viewed as a companion tool of such detectors, is proposed in a discrete framework and its formulation / computation holds in any dimension; in other words, it is valid in Z n , n ≥ 1. We show how this mixed gradient can be used to construct image priors that take edge orientation as well as intensity into account, and then involved in various image processing tasks while preserving curvilinear structures. Experiments carried out on 2D, 3D, real and synthetic images illustrate the relevance of the proposed gradient and its use in variational frameworks for both denoising and segmentation tasks.