Converting 2d Images to 3d

18
Converting 2d images to 3d The nutshell: An image is broken into layers, each signifying a different object or layer of depth. Each layer is filled using a grayscale fill, gradient at times, to signify what is further away from what is closer. General rule of thumb black is furthest back, white is furthest forward; the intensity of black to white is user choice (for example, I hardly ever go totally black or totally white because that level of intensity is not needed, usually just a dark grey to light grey scale will work fine), the shades of grey used to fill your layers you have to eyeout so to speak. It takes practice, but with time you develop a sense of how what shade you use will affect the depth of the object in your image. What do you need? Freeware and Shareware; where can you get it? You will need 2 programs a photo editing program that allows you to manipulate an image by breaking it apart into layers and grayscale fill accordingly with effects (blur, mainly), and a program that will use your depth mapin order to generate a second perspective. I recommend the following 2: GIMP GNU Image Manipulation Program, this is quite possibly the BEST Photoshop / editing software available for free Bas Relief 3.2 A program specifically written to generate a second perspective based off of an original image, and a depth map of said image. The free version, though limited, does allow you to produce 3d anaglyph imagery. Buying a license key (100.00 USD) will allow you to output full side by side True 3Dimages. These programs are (legally) available online at the following locations: http://www.gimp.org/ http://www.3dphotosoft.com/en/bas-relief Deciding what image to convert: Keep something in mind youre working off of a 2d picture. Any program that renders a second perspective, the main problem that ensues is that there is now unfilled space for this second perspective, no way to know what is behind an object. To accommodate this problem, most software (Bas Relief for sure) will analyze and stretch the surrounding objects to fill this space, making a guess at what it thinks should be there. Though it works fairly well, most photos will require a little clean up, especially if youre converting something intricate like a fence for instance, skinny lines that are stretched, etc. Photos with bold objects tend to convert the best and require the least amount of aftercare; it comes down to how much you want to put in to your conversion. That being said, on to the show..

Transcript of Converting 2d Images to 3d

  • Converting 2d images to 3d The nutshell: An image is broken into layers, each signifying a different object or layer of depth. Each layer is filled using a grayscale fill, gradient at times, to signify what is further away from what is closer. General rule of thumb black is furthest back, white is furthest forward; the intensity of black to white is user choice (for example, I hardly ever go totally black or totally white because that level of intensity is not needed, usually just a dark grey to light grey scale will work fine), the shades of grey used to fill your layers you have to eye out so to speak. It takes practice, but with time you develop a sense of how what shade you use will affect the depth of the object in your image. What do you need? Freeware and Shareware; where can you get it? You will need 2 programs a photo editing program that allows you to manipulate an image by breaking it apart into layers and grayscale fill accordingly with effects (blur, mainly), and a program that will use your depth map in order to generate a second perspective. I recommend the following 2: GIMP GNU Image Manipulation Program, this is quite possibly the BEST Photoshop / editing software available for free Bas Relief 3.2 A program specifically written to generate a second perspective based off of an original image, and a depth map of said image. The free version, though limited, does allow you to produce 3d anaglyph imagery. Buying a license key (100.00 USD) will allow you to output full side by side True 3D images. These programs are (legally) available online at the following locations: http://www.gimp.org/ http://www.3dphotosoft.com/en/bas-relief Deciding what image to convert: Keep something in mind youre working off of a 2d picture. Any program that renders a second perspective, the main problem that ensues is that there is now unfilled space for this second perspective, no way to know what is behind an object. To accommodate this problem, most software (Bas Relief for sure) will analyze and stretch the surrounding objects to fill this space, making a guess at what it thinks should be there. Though it works fairly well, most photos will require a little clean up, especially if youre converting something intricate like a fence for instance, skinny lines that are stretched, etc. Photos with bold objects tend to convert the best and require the least amount of aftercare; it comes down to how much you want to put in to your conversion. That being said, on to the show..

  • (I thought this would be a fun conversion example since its a play on perspective in the first place, proper 3d rendering will spoil the original effect! Take that smart photographer guy!) We now have our photo, examine and decide how you want to cut it into layers. Here are my notes (from back to front):

    1. Ground from front to back to Sky 2. Mountain in the back 3. Trees 4. The tower and small building to the right 5. People around the tower, fence structure 6. Girl holding the tower up

    6 layers total, time to start tearing the layers apart with GIMP.

  • Youll work out of 3 windows: Tools, The Image Window, and the Layers Window:

    Start by creating your six layers in the layer window (you can also do this on the fly your choice). If this is your first time using layers, think of each as a clear sheet of paper over the original image, which is a layer itself. Layers at the bottom of the layer window are at the bottom of your layer stack, IE what ever is drawn on a layer further up will be seen OVER what is on a layer down below. Right click on the pasted layer in the layer window, select new layer. You are then prompted to name the layer, name it 1. Repeat this step until you have layers 1 through 6:

    **Select a layer to work on by clicking it in this window, the eye icon when selected will make the layer visible, when not selected it will not be seen. You can drag layers to move them on top one another in a different order if you need to, or use the arrows below. The opacity for each can be controlled with the opacity slide tool above the layer window**

  • When I build a depth map, I find it easiest to draw what is furthest back then move forward, which generally will be your ground / sky / walls / etc. Just because the ground will be close up front doesnt make it your closest layer, everything is standing or sitting on top of it hence it truly is the back part of your map. This method (though it doesnt work for all pictures) will then offer you an easier way of correctly placing the other objects in your map because you can use their location vs this first filled layer as a reference point for grey scale with the color selecting tool. Did that sound confusing? It will make more sense later. LAYER 1 GROUND FRONT TO BACK AND SKY For this image, Im choosing to use a more extreme white to black gradient fill due to the perspective of the ground and the actual amount of it (a lot of distance is covered in just a little part of the picture):

    1. Select layer 1 2. Select the Blend Tool from your tool box 3. Select your shade of light and shade of dark 4. Gradient fill the image from the closest ground point (bottom of the image) to the furthest back

    point of the picture, think in terms of depth here; example: I am choosing to fill to about mid way up the mountain as to offer a little shade difference between the sky and the mountain (since the mountain is our next depth layer), remember lightest is closest, darkest is furthest:

    Ill click the eye icon next to layer 1 to make this layer invisible to the naked eye, now we can move on to the next layer. (Keep in mind even if a layer is selected to be invisible, it still exists and is there you just cant see it and can now see what is under it, but anything you do to the selected layer drawing on it, pasting on it by mistake, etc. it would all still happen but you wont see it until you select the eye icon again to make it visible. Make a mental note to ALWAYS PAY ATTENTION TO WHAT IS VISIBLE, WHAT IS NOT VISIBLE, AND WHAT LAYER YOU ARE EDITING!!!)

  • With our next layer, well need to rotoscope the mountains. What is that? Simply defining an object by outlining it. There are assist tools out there, however my best results always come from when I do it manually therefore that is how were going to do it here. LAYER 2 MOUNTAIN IN THE BACK This is an easy layer, not much is visible:

    1. Select layer 1 2. Select the color picker tool 3. Click anywhere in the darkest portion of the layer which will set your current draw color 4. Click on the color in the color preview window to bring up the extended color options, carefully

    click a shade of grey slightly (a few notches) lighter than the current selection, then hit okay you now have your mountain layer color

    5. Select layer 2 6. Using your free select tool, click click click, begin to outline the visible portions of the

    mountain. Anything that will be behind another layer you dont have to worry about being exact with. Once the outline is completed, the rotod area will remain outlined.

    7. Fill the area with the bucket fill tool (set the threshold to max setting) (6)

    (7)

  • LAYER 3 TREES With this layer, were going to use layer 1 to find the exact shade of grey needed to properly place the depth of the trees. Thats the beauty of a gradient filled ground or wall I talked about earlier, it creates a depth key for the rest of your map to work off of.

    1. Because your roto area from Layer 2 is still selected, click the rectangle select tool, then click anywhere outside of your image this will highlight the entire image. Failure to do so, GIMP will only allow you to select and work off of whatever was in the rotoscoped area.

    2. Select Layer 1, make sure both layer 1 and 2 are not visible 3. Using the color picker tool, click at the very bottom of one of the trees on the left you now

    have selected the shade well use for your tree layer 4. Select Layer 3 5. Rotoscope your trees 6. Use the bucket fill tool to fill this area

    (5)

    (6)

    Halfway point Wahoo!!

  • Take a second to make all layers visible and your map should resemble the following:

  • LAYER 4 THE TOWER AND THE STRUCTURE TO THE RIGHT Because the tower is round, were going to try and create some of that effect with its fill a flat grey would make it flat but a gradient fill from the center to the edges will help make it feel a little more real. There are different methods on how you can do this, Im going to go with what I think is the easiest route

    1. Because your roto area from Layer 3 is still selected, click the rectangle select tool, then click anywhere outside of your image to highlight the entire image.

    2. Select Layer 1, make sure both layer 1 and 2 are not visible 3. Using the color picker tool, click at the very bottom of the center of the tower. Click the swap

    arrows above your color preview windows. Using the color picker tool, again click at the bottom of the tower but this time at the far left part of the bottom, which is a little bit higher up then the center. This will select a slightly darker shade than your first selection, also creating the scale for our gradient fill. Click the arrows again so you set the lighter (closer) shade to the top window.

    4. Select Layer 4 5. Rotoscope the tower 6. Select the blend tool, then in the options below set the shape from linear to bi-lenear 7. Click in the middle of the tower, then drag right until you get to the edge of the roto line (your

    drag line should be a right angle to the towers lean) let go of the mouse and the object should fill lightest in the center to darker on the edges. Be sure to set your fill shape back to linear now so you dont forget to do so later

    8. Click the rectangle select tool, then click anywhere outside of your image to highlight the entire image.

    9. Select Layer 1 10. Using the color picker tool, click at the very bottom of the structure to the right 11. Select Layer 4 12. Rotoscope this structure 13. Use the bucket fill tool and fill it in

    (5)

  • (7)

    (12)

    (13)

    **at this time I want to point out there are a lot of other things we could do to make this look better but for the sake of an example, Im not going to get into the details. I would suggest modifying the bi-lenear fill, when rotoscoping to use the subtract selection part of free select to remove parts that are see through, the pillars to the background, etc. Get creative with your shot skills!**

  • LAYER 5 PEOPLE AND THE FENCE STRUCTURE Were only going to worry about the front line of people and the fence since this isnt a very detailed map.

    1. Because your roto area from Layer 4 is still selected, click the rectangle select tool, then click anywhere outside of your image to highlight the entire image.

    2. Select layer 1 3. Using the color picker tool, click right at the line where the grass ends and concrete begins, this

    is a good shade for the fence and closest people in front of the tower 4. Select Layer 5 5. Rotoscope the people, fence, concrete stairs to the left, the box to the bottom left of the tower,

    all the little up front things. Another option is to use the draw tool and draw over the people, but to keep it simple we will roto using the free select tool again

    6. Using the bucket fill tool, fill the area (5)

    (6)

  • Take a second to make all layers visible, your map should look like the following:

  • LAYER 6 GIRL HOLDING UP THE TOWER If you closely examine the picture and where she is at, youll be able to tell she is actually standing on something in fact part of the structure she is standing on is visible in the bottom right part of the window. So far weve been using the first layer to choose our grey shades but in this case, because she is not actually on the grass but even closer, were going to use a blinding white to fill her in. Because it appears her right hand is going back towards the tower, well choose a second color for the linear gradient fill so it appears her arm is slightly dipping away from the rest of her body. Were also going to cut out the visible area between the legs so the grass depth will not be effected, same with the space between her left arm and torso.

    1. Because your roto area from Layer 5 is still selected, click the rectangle select tool, then click anywhere outside of your image to highlight the entire image.

    2. Select Layer 6 3. Set your primary color to white, set your secondary color to a few notches below white (a hint

    of grey) 4. Rotoscope the girl and the visible framework in the bottom right 5. After youve completed the outline, in your free select options, set the mode to subtract from

    current selection 6. Rotoscope the area visible between the legs once completed, this area will be removed from

    your original rotoscoped shape 7. Rotoscope the area visible between her left arm and body once completed this area will also

    be removed from the original rotoscoped shape 8. Set your free select tool back to replace current selection so you dont forget to do so later 9. Select the Blend tool, then from the shoulder of her right arm, drag to the edge of her hand that

    appears to be holding up the tower. A fill in this manner will fill anything right of your starting point with the primary color, but anything on your drag line left with the gradient fill

    (3)

  • (4)

    (5) & (6) (notice the sections that are now removed from the original roto shown in (3)

    After your fill, now is the moment of truth your map should be completed.. Because your roto area is still selected, click the rectangle select tool, then click anywhere outside of your image to highlight the entire image.

  • Make all layers visible, and your map should now look like the following:

    Go ahead and save a copy now, dont save over your original obviously, and do not specify the file format (it will default to GIMPs layer format this will be your hard copy in case you need to go back and make layer changes)

  • One last step before we save this as a JPG: Well need to flatten the layers, which basically combines them all into a single layer, then well slightly blur the image using the Gaussian effect you normally dont want hard edges on a depth map, it will cause funny results rendering the second perspective.

    1. In the Menu options, select image, then select flatten youll notice all of your layers are now combined as one in the Layer window

    2. In the Menu options, select Filters, Blur, Gaussian blur. A horizontal and vertical blur level of 5 generally works well across the board. This is also the default, so simply press OK.

    Your depth map is complete, save a copy as a JPEG be sure and label it your map in the title.

  • CONVERTING YOUR PICTURE WITH BAS RELIEF This program is very self explanatory load your original on the left, your depth map on the right, set the parallax of the image (the strength of the 3d effect, or basically the distance between the left and right views default is 4% and this translates very well most of the time), the stereo window position allows you to set the default window, basically whether your image is all depth, depth with some pop, or completely off the screen pop (default 100 is all depth), then select the convert type below (anaglyph). You can save black and white, semi color, or full color anaglyph.

    Youll be prompted to name your converted image, I recommend you slip the word anaglyph into the name somewhere dont save over anything. Viola a converted 3d image

  • Using 4% parallax, 100% stereo window setting (all depth):

  • Using 4% parallax, 75% stereo window setting (mostly depth, little pop):