

       2D to 3D image conversion tutorial Beta: 0.99.2.21.a




All rights reserved some restrictions do apply.

---------------------
1.0) Establish intent
---------------------

a.  Boy is this difficult ! Are you sure you want to do this ?

-------------------------------------------------------------------
2.0) Begin aquisition of image to be converted and initiate process
     of image manipulation for height field generation.
-------------------------------------------------------------------

a. You will need to start by selecting a suitable image for the
   conversion process. Pictures that are well suited to the process
   will have lighter colors in the areas you want to convert. Dark
   areas are difficult to work with as they produce very little depth
   to the HF object. Sharpness and definition of the form to be
   converted will also impact your success. A blurred out line of an
   object will be difficult to isolate and lowers chances of success.


b. Once you have carefully choosen the image you want to convert
   open the image into a good paint program. The first thing to
   do is examine the image for defects, pixelated areas from prior
   conversion processes, and uniformity of shading.

c. This next part is difficult to explain if you have little prior
   experience with paint programs and graphics filters but we will
   discuss it as we go. The first thing I do is if the image has
   a lot of jpg artifacts is apply either a soften filter or blur
   filter. The effectivness of each one depends on how bad the original
   you are working with is. Soften is better if you can get away with
   it as it leaves better outlines for the image, Once you are happy
   that the image is clear of the defects ( as much as possible)
   converst the image to a .tga file format and save as image_col.tga.
   I use naming conventions to identify which image is to be used for
   what part of the process. As the last one we just worked on will
   be used as the color image map later I choose _col.tga as the
   identifier. Choose whatever you like.

d.    Now that you have you image map image established it's time to
   prepare it for the final processes. There should be something in
   the scene that you wish to use. To do this it needs to be isolated
   from the rest of the image.
      The easist way to handle this is by blacking out the rest of
   the image with the various tools avaiable in paint programs. For
   large areas a paint brush with a large size can be used to fill
   large areas while sticking to smaller tipped tools, like a pen
   tool, when working in the more detailed areas.
      Areas that also need attention paid to them would be around
   legs, arms, poles in a grill work area, or any where you would
   normaly see through an object. This is an important part if you
   want to achieve a better 3D object when done. These details are
   visibly obvious and need to be take into account.
   >>>What ever you do make sure that as you complete a difficult area
   that you save your work. There is nothing worse than completing a
   difficult piece of geography and then turn around and do something
   stupid. You hit the undo and it all goes away.
      Once you are reasonably sure that it is blacked out save the
   file. If your program allows it convert the colors to a reversed
   image, just like in photo negatives and positives. This will allow
   you to see the areas that you have missed. Use a color picker tool
   to set the color of your brush, or just use white, and finish
   touching up the now obvious areas that you missed. Convert the
   file back to a positive image again and save it.

e.   We are almost there - whew ! Save the image again with a new name.
   This time we will call it image_gs.tga. In this case gs.tga is for
   gray scale because that is what you will do now. Hopefully your
   program will be able to do color to gray scale conversions. If so
   do so now. Save the file. Check it again for areas that need to be
   touched up and don't hesitate to use the nagative feature of your
   program to find this out.
      Once you are satisfied that it's touched up as much as it's
   going to get it's time to evaluate what you have to work with.
   If you still have dark (almost black) areas inside of the object
   to extract you will need to try to lighten those areas a little
   bit. If you go overboard it will cause big problems so if you
   decide to do this do it at a very conservitive level. You can
   always go back later and lighten it more but it is difficult to
   reverse the process. I usualy leave the individual areas alone
   until I get to the step later where I can render the image and
   evaluate it then.
      A better approach is to view the object to be extracted in a
   general way. If the majority of the image is considerably lighter
   in apperence than the black background it should be ok. Remember
   that areas of pure white should also be avoided as they are the
   highest elevation points on a HF. Sometimes all that needs to be
   done is a little brightness adjustment along with a contrast change.
   Sharpness counts a lot in this process.

     So here you are with an image called image_gs.tga. It has a
   black background, and an area that is shades of gray. You are
   ready for the nest step in the process. I like to keep a copy
   of this for later process adjustments and save a new copy as
   image_lev.tga. This will be the image you import into the
   program Leveller to finish off the final part of the process.

*****************************************************************

Notice:

     In an attempt to save space on the Povray new server and reduce
   download time I was forced to convert all of the .tga images to
   .gif images. Leveller will only accept .tga files wo you may want
   to convert the examples back to tga so you can follow this next part.

     The second option is to recreate the images using the instructions
   in the last section and then proceed from there. In that case you
   can use the .gif files for comparison sake or just delete them as
   you see fit.

******************************************************************


---------------------------------------------------    
3.O) Using Leveller to get more bang for your bucks
---------------------------------------------------

Note: From here on out your changes to the image will be saved
      as .ter leveller files so no more tga's will be required
      other than those that leveller produces, and the images
      you have saved at the steps leading to this.

   
a.   Open the program Leveller. Choose edit from the menu bar and
   choose edit grid size. A diaolg will pop up giving you choices
   for the grid size to use. In this case choose custom and enter
   the height and width of your image. Close out of this step and
   from the file menu choose import file. This puts you in the
   standard windows file search and go to where you have your
   image_ter.tga file at. Once back in leveller it will ask you
   about elevations and some other stuff, just accept the defaults.
     Leveller should now display the image you have been woking on
   so hard as a gray scale looking thing in the right window. That
   is similar to how it will appear when you are done except the
   area in the background, which should be flat and uniform gray
   now, will be cut away using the water level feature in pov. More
   on that in just a little while. 
     I would suggest before you do anything you save the file as a 
   Leveller .ter fil. Call it image.ter or whatever you like. To get
   an idea how much work is involved in getting your object the way
   you want it now is a good time to ask leveller to export to Pov
   as both a file and a HF image. It will ask for two names for the
   files. I use image_l.pov for the pov file and image_hf.tga for
   the HF map.

b.   Open Pov, your new .pov file and render the scene. You may need
   to adjust the camera to see it. You will also need to add a water
   level statement to the HF to cut away the background. Something
   like water_level .01 will be close but may need tweaking. As you
   look at the image note the areas that are going to need adjusting.
     Some will need to go up others will need to go down. Once you
   have an idea where the adjustments are needed go back to leveller
   and open the .ter file you saved earlier. Using the various tools
   at your disposal begin to adjust those areas that need them. The
   area rubberband selection tools are an excellent resource for
   constraining your activities to a single area.
   Use them a lot !!!!!!!
     Once you've made some changes do the Pov routine again and see
   how you did. I would use the same naming conventions you used the
   first time or your hard drive will fill up quickly. It is again
   your choice what you do in that regard. Maybe a couple of early
   backup files would not be a bad idea in case you really mess it
   up later and want to try it close to the start without having to
   repeat every step.

c.   Somewhere along the line it would be nice to see how it is going
   to look with the image map attached to it. Leveller can do this
   for you too. Choose the textures set up dialog and go through the
   routine necssesary to attach an image to the HF object. It should,
   once complete, show up in the area on the left. Save the file and
   export to pov again. This time leveller will also attach the image
   map to the HF for you and make sure it's lined up properly.
   
   
d.  From here you are pretty much on your own. It takes time to get
   used to the tools and the adjustment of different areas is not
   something I can teach you without being there. All I can say is
   that it takes a good amount of trial and error to get right and
   patience prevails in the end.


4.0) Final Process

a. Render final scene using highest quality settings

b. Show it to the world and sit back waiting for the praise to roll in.

c. There is no step C as you are now done.


End - Whew !!!

(C) Copyright 02-21-1999 by Ken Tyler.


