(* Initialize *)
Name:="Example";
(* Rules for mixing images. *)pixelmap[pixel1_,pixel2_,pixel3_]:=((pixel1*pixel2)+(1-pixel3)-(pixel1*pixel2)*(1-pixel3))*0.8+pixel1*0.2;
SetDirectory[NotebookDirectory[]];
(* The function to be used. Here we have f(z) = sin(z) *)
f:=Function[{z},
(* Insert function here. *) Sin[z]
];
(* Use this to easily pass the function through a conformal map first. *)
CM:=Function[{z},z];
(* If you want to project the image onto a globe, *)
(* set globe:=Function[{z},(1-(2/Pi)*ArcCos[Abs[z]])*z/Abs[z]]; *)
globe:=Function[{z},z];
(* Scales the contour lines. *)
ContourScale:=1;
(* Composes the f function with the conformal map CM. *)
F:=Function[{u,v},f[CM[globe[u+I*v]]]];
(* Box for plotting. *)
xleft:=-5; xright:=5; ybottom:=-5; ytop:=5;
(* Quality settings. Max recursions, Resolution, Image Size (in pixels). *)
mr:=1; Res:=200; IMSize:=500;
(* These define the main images. *)
ABS:=DensityPlot[Sqrt[Abs[Sin[0.5*Pi+ContourScale*Pi*Log[Abs[F[x,y]]]]]],{x,xleft,xright},{y,ybottom,ytop},ClippingStyle->Automatic,Frame->False,PerformanceGoal->"Quality",PlotPoints->Res,ImageSize->IMSize,PlotRange->All,ColorFunction->(RGBColor[#,#,#]&),ColorFunctionScaling->False,Exclusions->None,AspectRatio->1,MaxRecursion->mr,ImagePadding->0,PlotRangePadding->0];
ABS2:=DensityPlot[Sqrt[Abs[Sin[ContourScale*Pi*Log[Abs[F[x,y]]]]]],{x,xleft,xright},{y,ybottom,ytop},ClippingStyle->Automatic,Frame->False,PerformanceGoal->"Quality",PlotPoints->Res,ImageSize->IMSize,PlotRange->All,ColorFunction->(RGBColor[#,#,#]&),ColorFunctionScaling->False,Exclusions->None,AspectRatio->1,MaxRecursion->mr,ImagePadding->0,PlotRangePadding->0];
HuePlot:=DensityPlot[(1/(2*Pi))*Arg[F[x,y]],{x,xleft,xright},{y,ybottom,ytop},ClippingStyle->Automatic,Frame->False,PerformanceGoal->"Quality",PlotPoints->Res,ImageSize->IMSize,PlotRange->All,ColorFunction->(Hue[#,0.75,1]&),ColorFunctionScaling->False,Exclusions->None,AspectRatio->1,MaxRecursion->mr,ImagePadding->0,PlotRangePadding->0];
(* To exclude regions,for example displaying only the unit circle,add *)
(* RegionFunction->Function[{x,y},x^2+y^2<1] to all density plot settings. *)

(* Combine to render final image. *)
Timing[Export[Name<>"-"<>".png",ImageApply[pixelmap,{HuePlot,ABS2,ABS}],"PNG"]]