I would suggest using pst-slpe
:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/5sxGB.png)
\documentclass{article}
\usepackage{pstricks}% http://tug.org/PSTricks/main.cgi/
\usepackage{graphicx,pst-slpe}% http://ctan.org/pkg/{graphicx,pst-slpe}
\newsavebox{\imagebox}
\begin{document}
\savebox{\imagebox}{\includegraphics[width=4cm]{tiger}}
\begin{pspicture}(\wd\imagebox,\ht\imagebox)
\psclip{
\usebox{\imagebox}
}
\psframe[linestyle=none,%
fillstyle=slope,slopebegin=green,slopeend=green,slopeangle=-45,
fading,startfading=0,endfading=1](0,0)(\wd\imagebox,\ht\imagebox)
\endpsclip
\end{pspicture}
\end{document}
The fillstyle
can be adjusted to a variety of other options, all specified in the pst-slpe
documentation.
Perhaps more true to your image:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/LXEiM.png)
\documentclass{article}
\usepackage{pstricks}% http://tug.org/PSTricks/main.cgi/
\usepackage{graphicx,pst-slpe}% http://ctan.org/pkg/{graphicx,pst-slpe}
\makeatletter
\def\psfs@customfill{%
\addto@pscode{%
\psx@slopecolors\space
\psslopesteps\psx@slopecenter\space\psx@sloperadius\space\psx@slopeangle
\ifPST@fading \psk@startfading \psk@endfading true \else false \fi
tx@PstSlopeDict begin CustomFill end}}
\makeatother
\pstVerb{
/CustomFill {
/Fading ED % do we have fading?
Fading {
/FadingEnd ED % the last opacity value
dup /FadingStart ED % the first opacity value
/Opacity ED % the opacity start value
} if
gsave
rotate
/Radius ED
/CenterY ED
/CenterX ED
/NumSteps ED
Fading { /dOpacity FadingEnd FadingStart sub NumSteps div def } if
clip
pathbbox
/h ED /w ED
2 copy translate
h sub neg /h ED
w sub neg /w ED
w CenterX mul h CenterY mul translate
PatchRadius
/AngleIncrement 90 NumSteps div def %/AngleIncrement 360 NumSteps div neg def
/dY AngleIncrement sin AngleIncrement cos div Radius mul def
/DrawStep {
Fading { % do we have a fading?
Opacity .setopacityalpha % set opacity value
Opacity++ % increase opacity
} if
0 0 moveto
Radius 0 rlineto
0 dY rlineto
closepath fill
AngleIncrement rotate
} bind def
Iterate
grestore
} def
}
\newsavebox{\imagebox}
\begin{document}
\savebox{\imagebox}{\includegraphics[width=4cm]{tiger}}
\begin{pspicture}(\wd\imagebox,\ht\imagebox)
\psclip{
\usebox{\imagebox}
}
\psframe[linestyle=none,%
fillstyle=customfill,slopecolors={0 0 1 0 1 0 1 0 2},slopecenter=0 0,
fading,startfading=0,endfading=1](0,0)(\wd\imagebox,\ht\imagebox)
\endpsclip
\end{pspicture}
\end{document}
The above uses an updated version of the radslopes
fill style and it's accompanying PostScript definition. The only thing that has changed is the cycle/angle, which now spans 90 degrees clockwise, rather than 360 anti-clockwise. Additionally, the slope center is specified in the lower left-hand corner using slopecenter=0 0
.
The following code snippet uses the above customfill
to make a radar-effect:
![enter image description here](https://cdn.statically.io/img/i.sstatic.net/3VzTl.gif)
\multido{\i=0+5}{72}{
\newpage
\begin{pspicture}(\wd\imagebox,\ht\imagebox)
\psclip{
\usebox{\imagebox}
}
\rput{\i}(.5\wd\imagebox,.5\ht\imagebox){\pscircle[linestyle=none,%
fillstyle=customfill,slopecolors={0 0 1 0 1 0 1 0 2},%slopecenter=0 0,
fading,startfading=0,endfading=1](0,0){.5\wd\imagebox}}
\endpsclip
\end{pspicture}
}
MWE
the opacity value of the last sector is0.01111*44=0.48884
.