Does G’MIC ship with any tools for reprojection? Specifically to re-project the zenith and nadir from a 360x180 equirectangular image into rectilinear projections, and then the reverse of that to re-project the two rectilinear images back into the equirectangular image. If not, could I tickle your or someone’s interest who knows G’MIC and is capable of coding this?
MathMap was a very interesting project, a plugin for GIMP which let you code such things in a simple way, but sadly it’s been dead for a long time and I see G’MIC as having taken its place. If you are interested in implementing this, or if you can point someone you know to this request, someone who might be capable and interested in implementing it, then maybe this code I used in MathMap can help.
This part takes an equirectangular image at a 2:1 aspect ratio and spits out two rectilinear adjacent 1:1 images on a 2:1 layer.
Reproject rectilinear zenith and nadir from equirectangular:
filter ToNadirZenith (image in) # Filter created by Seb Przd # Licensed under the GPL if x<0 then sinphi1=1; xx=x+X/2; else sinphi1=-1; xx=x-X/2; end; yy=y; rr=sqrt(xx^2+yy^2); c=atan(rr/Y); phi = if rr == 0 then 0 else asin(cos(c)*sinphi1) end; xxx=atan(xx,-yy*sinphi1)*X/pi; yyy=phi*Y/(pi/2); in(xy:[xxx,yyy]) end
This part takes the 2:1 layer and reprojects them onto the 2:1 canvas, so you end up with the zenith and nadir at the top and bottom and transparency in the middle.
Reproject rectilinear zenith and nadir into equirectangular:
filter FromNadirZenith (image in) # Filter created by Seb Przd # Licensed under the GPL output=1; if y>Y/4 then sinphi1=1; xc=-X/2; else if y<-Y/4 then sinphi1=-1; xc=X/2; else output=0; end; end; cosc=sinphi1*sin(y/Y*pi/2); xx=cos(y/Y*pi/2)*sin(x/X*pi)/cosc; yy=-sinphi1*cos(y/Y*pi/2)*cos(x/X*pi)/cosc; if abs(xx)>1 then output=0; end; if output then in(xy:[xx*X/2+xc,yy*Y]) else rgbaColor(0,0,0,0) end end