Photorealistic Panoramas


    Attached is a photorealistic panorama of the Longview Community College campus (Lee's Summit, MO) for Starry Night. I followed the directions on this web site for making a photorealistic panorama for our campus but did so with a few differences.

    The images were taken using a tripod and I took around 28 images for making the panorama.I then used a freeware program called Hugin-Panorama Stitcher to create the panorama. This is a very easy program to use. Normally I would have used Photoshop Elements but it kept crashing during loading the images. I had no problem with the Hugin program. Once the panorama was made, as a large Tiff image file, I loaded it into my Photoshop Elements program.

    In the Photoshop editor I used the background erase tool to erase the sky from the picture. The original directions called for using an alpha channel to make a mask for the image. I wasn't sure how to do that in the Elements version but using the background eraser worked well. I did have to zoom in on the image to clean up spots I missed. To see if I had missed any places I set Starry Night for sunset. Any spots I missed would show up as reddish against the darker background. They also do not move with the sky as time advances.

    The panorama and corresponding text file simply go in the Horizon Panoramas folder. I edited one of the text files in the folder to match the name for my panorama file. It was also renamed to be the first panorama and the default one at program startup. I also had to make adjustments to the positioning values as described in the original directions for making a panorama.

    One other thing is that the panorama file was more than 50 Mb in size as a Photoshop psd file. Using Photoshop Elements I used the save for web function and changed the file to a png file. This reduced the file to the 7-8 Mb size it is now.

    Clear Skies...

    Bob Riddle

    Adjunct Faculty-Astronomy


    • Avatar
      Dave Howe

      Great panoramic above!!!! Mine was a quick and dirty, more pictures would have produced a better panoramic result. Bob's above was well done with 28 images, mine was done with about 10. That's why mine has more pronunced and jagged boundries between images. So I'll go back and attempt with more pictures. It works great by the way. Tonight (11/6/11) Jupiter rose over my neighbor's tree exactly as it did in starry night (pretty cool).
      Here is how I did mine.

      1. Take pictures. I used a Canon 20Da, same one I take astrophotos with. Use as wide angle a lens as you can. Really more for the x axis (up and down) more than anything. You can take less images with the wider angle, but more is apparently better, depending on how many your "stitching" program can take before it chokes. I used a tripod, set up as close to on top of my telescope as possible. I leveled the camera via the tripod as closely as I could. I then took around ten shots as I rotated the camera around horizontally. I started out with my first picture to the south, and for some reason it worked easier. So I suggest starting your first picture facing south. Also note where North is. If you know where polaris is in the sky, mental note where it is in relation to your horizon. Note a light pole, a tree or something. It will help later. I overexposed/pushed a little to get the sky to be very white (easier later to get the alpha channel right)

      2. Process and Stitch pictures. I downloaded all the pictures to my computer and edited them. I saved them as jpegs. I stitched them into a 360 degree panoramic using "Canon Photostitch 3.1". This application came with my camera. It is effective, but old. Make sure you use the "360 panorama" function in whatever app you use. not merely a "panorama". I made that mistake. They are not the same. There are many other "stitching" apps out there. I don't have a specific recommendation. Obviously Bob's (above) works very nicely.

      3. Crop to 512 X 4096.     Open the image in Photoshop.  I use photoshop CS3.  With the Crop tool crop the image to 512 pixels in height and 4096 pixels in width.  Simply select the crop tool and type into the width window "4096 px" and "512 px" into the height window.  spread the tool to include your whole image in width.  Don't worry about the height, just include the highest horizon object and it should be fine.

      4. Add Alpha Channel . This initially appears daunting, but really isn't all that hard. I use photoshop CS3.

      a. I open my newly "stitched" and Cropped jpeg.

      b. Under the "layers" tab I right click on the "background" layer and select "Layer from Background"

      c. Name the new layer....."horizon"...or "my horizon"...or..."whatever". Hit "OK"

      d. Adjust the brightness and contrast so the sky becomes quite white, while still leaving your "horizon", or darken the foreground/horizon. either works. Try both.

      e. On the upper menu bar...hit ..."Select" -- "Color Range.." . I set the "select" window to "sampled colors, The fuzziness slider to midlevel to high, "selection" button selected. "selection preview" window to Black Matte. Then click in the sky. You can also hold the "shift" key and click and drag in the sky. Experiment with this till you get the best defined horizon. ( i.e. mostly white sky and black below). don't worry if there are white spots below or dark ones above, we'll edit those out. just get the best you can now...less work later. Hit "OK" . again Hit "Select" then "Inverse". Important. don't forget "Inverse"

      f. On the bottom of the "layers" Tab/workspace there are a few selections, starting with a small chain. The third one in is a rectangle with a circle in it. (Add layer mask). Select it.

      g. Right next to the "layers" tab is the "channels" tab. Select it. Put an eyeball in the "mask" channel and deselect eyeballs in the RGB channels. This is your Alpha channel. You can now edit to your heart's delight. Use an eraser in the sky, and a white brush below. Also adjust Brightness/contrast, and "curves" , all work great here. Everything black will be see through and everything white will be opaque in Starry night. ( I made windows in houses black. Then stars passing behind the house show through the windows).

      Now put eyeballs in the RGB channels and you'll see your image with checkerboards where sky will be. You've done the hard part, now save it as something cool like "our backyard observatory.psd". Save in the ".psd" format. Don't get caught up in the whole "dds" format deal. I did, and I wasted a whole lot of time and energy. The ".psd" format works just fine, even in the newer versions of Starry Night. ( I'm using Pro Plus 6)

      Here is a little visual help that helped me.==>

       4. Put into Starry Night.

      a. In your computer navigate to where Starry night is. Probably "C:Program Files (x86)/Starry Night Pro Plus 6/"or something similar. find the "Sky Data" folder. Then the "Horizon Panoramas" folder. Right click on one of the text files (.txt). Any one will do. Copy it to the same folder. Rename the copy something cool, like "our backyard observatory.txt"

      b. Now navigate to..and copy... the .psd file you previously made (you named it something cool, like our backyard observatory.psd". Copy it to the same folder as above ( something like "C:Program Files (x86)/Starry Night Pro Plus 6/Sky Data/Horizon Panoramas/")

      c. You should now have two new files in the "Starry Night Pro Plus 6/Sky Data/Horizon Panoramas" folder. A ".psd" and a "txt" file. Preferably they also have the same name. i.e. "our backyard observatory"

      d. Open the text file(.txt) by double clicking. Then use the "edit"..."find.." enter "PanoName" ,find next. In the "value"area between the quotes enter some thing cool, like "our backyard observatory". Further along that same line you'll find "ImagefileName". Change that value to your panoramics name, i.e. "our backyard observatory.psd". Save the text file. Even though you have saved this file...remember where it is. You will be returning to it many times to adjust it. the"values' remaining to be adjusted are; " ImageHeight" ..... angular height of your image, "ImageCentreDec" high relative to the horizon your image is. "ImageCentreRa".......rotational, i.e azimuth of your image. in other words -twirling it around.

      5. Adjust the Panorama to fit.

      a. Start Starry Night. wait, wait, wait while it loads. Then under the "Options" tab on the left (not on the top) Options--Local view--Local Horizon--photorealistic--click on the picture of the horizon--hopefully yours should now be it. Don't worry if it doesn't look exactly right, We adjust next. Before you exit Starry Night you need to make your new horizon the default. This time select "Options" from the top menu not the left. then " Save Current Options As Default"

      b. The Three "values" in the horizon's associated text file that are remaining to be adjusted are:

      " ImageHeight" ..... angular height of your image
      "ImageCentreDec" high relative to the horizon your image is
      "ImageCentreRa".......rotational, i.e azimuth of your image. twirling it around.

      You have to set each of these values by trial and error to get your computer to match the sky. go to the exact spot you took the pictures. Note the differences between Starry Night and your real sky. adjust the three values above and works.

       Good Luck!!

    • Avatar
      Dave Howe

      Oops forgot to attach the .psd example file

    • Avatar

      Dave Howe's instructions were VERY helpful.  I finally have an alpha channel on my panorama.  However, I frankly don't see any difference between the new one and the one that I created without an alpha channel.  Either I'm doing something wrong, or the alpha channel doesn't make any difference.  When I "rotate" the sky, stars disappear when the go behind hills or buildings, just as they should in both versions.


      By the way, I created a panorama with much higher resolution than suggested in the "help" page.  Mine is 14,000 by 1,750.  It seems to work fine, although it is slow to start.  Other than that, is there a reason not to use a higher resolution that 4096 by 512?

      My panorama without the alpha channel is is about 94 KB.  The one with the alpha channel is about 87 KB.

      Sam Rhoads.


    • Avatar
      John Huebner

      You don't need to specifically select "Alpha Channel" from a menu. If You start from a transparent image in photoshop elements, paste in your panorama and cut away the sky. On windows, I saved as a PNG file, not a PSD, and it worked fine.

    • Avatar

      Does this process also work for Sky Safari 6?