GD script for web/server creation of images

  • What would be really cool is if we had the ability to have a web-based set of krpano Tools / scripts.

    Upload an image, leverage the scripting, and out comes the 6 faces and preview.

  • I experimented with using imagemagick to convert from spherical to cubic, but found that the performance was severely lacking in comparison to the krpano tools. Here's an example, extracting the top face from an equirectangular:

    Code
    convert equirectangular.jpg ( +clone -set option:distort:viewport %%[fx:w/PI]x%%[fx:w/PI]+%%[fx:(w-w/PI)/2]+%%[fx:(h-w/PI)/2] -distort SRT 0 ) +swap -interpolate bicubic -fx "xx=i/w-.5;yy=j/h-.5;ofs=(xx<0)?.5:1.5;pan=(yy==0)?ofs*pi:atan((xx)/(yy))+2*pi;pan=mod((yy>0)?pan+pi:pan,2*pi);tlt=(xx==0&&yy==0)?0:mod(-atan(.5/hypot(xx,yy))+pi/2,pi);v.p{ pan*v.h/pi, tlt*v.h/pi}" out.png

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!