Let $\Omega= \{(x,y) : \frac{1}{2} \leq x^2+y^2 \leq 1\}$ and $S = \{(x,y) : x^2+y^2 = 1\}$ the unit circle, and $X=w^{1.\infty}(\Omega;\mathbb{R})$ the space of Lipschitz valued functions. We denote by $\left| \cdot \right|$ the euclidean norm in $\mathbb{R}^2$ or the modulus in $\mathbb{R}$.
Given $\phi \in C^\infty(\Omega;S)$, I am looking for a continuous linear operator $P$ acting on $X$ such that
For all $f\in X$, $$ |D(Pf)\cdot \phi| = |D(Pf)| , $$ and
$$\text{ If } |Df \cdot \phi| = |Df| \mbox{ in } \Omega, \text{ then }P(f)=f.$$
In other words, if the gradient of $f$ is parallel to $\phi$ then $f$ is unchanged by $P$, whereas if it isn't, $P$ "projects" it on that space.
There is one simple case when one can do it naturally, it is when $\phi = (x,y)/|(x,y)|$, as in this case one can choose $$ Pf(x,y) = \frac{1}{2\pi}\int_{0}^{2\pi} f\left(|(x,y)|\cos \theta, |(x,y)| \sin \theta \right) d\theta. $$ As $Pf$ is radial, $D(Pf)$ is parallel to $\phi$.
If there exist two sufficiently smooth functions such that $u,v$ such that
a. $\phi= Du$
b. $\min \det (Du,Dv)>0$
c. $v$ is such that for all $u$ $$ \int_{\{u=c\}\cap\{x\in \Omega\}} dv=1 $$ then, writing $$ x=s(u,v) \text{ and } y=t(u,v) $$ we can generalize the radial case to $$ Pf(x,y) = \int_{\{v : (s(u,v),t(u,v))\in \Omega \}} f\left(s(u(x,y),v),t(u(x,y),v)\right) dv. $$ As pointed out by Mikhail Skopenkov in his remark, this is easier said than done. Suppose $\phi=(1,0)$, then $u=x$; but the natural choice of $v=y/l(x)$, where $$ l(x)=\begin{cases} 2\sqrt{1-x^2} & \text{ when } \frac{1}{\sqrt2}\leq |x| \leq 1 \\ 2\sqrt{1-x^2} - 2\sqrt{\frac{1}{2} - x^2}& \text{ when } 0 \leq |x| < \frac{1}{\sqrt2} \end{cases} $$ does not work, as $l$ isn't Lipschitz at $x=1/\sqrt{2}$, in fact only in $W^{1,s}$ for $s<2$, thus $$ Pf(x,y) = \int_{v : (x,v l(x)) \in \Omega} f\left(x,v l(x)\right) dv, $$ which is indeed a function of $x$, and corresponds to averaging $f$ in the direction $(0,1)$ orthogonal to $\phi$, isn't regular.
Any hint on how to go for general directions $\phi$ would be great.