3D Lenticular Printing Interlacing Algorithm Illustrated Using Photoshop
3D Lenticular Printing Interlacing Algorithm Illustrated Using Photoshop
Introduction
3D Lenticular printing has become more affordable because of the ever
lowering prices of digital printing equipment found in homes and offices. There
are many downloadable software products on the market designed for this
special form of printing; some free and some for a medium to high price. By and
large these products serve one main purpose; i.e. to interlace pictures to be
viewed through lenticular sheets.
This article tries to demystify the underlying working of interlacing software. By
understanding how pictures are interlaced and then combined, you will be able
to appreciate the principles of lenticular printing better. This knowledge will also
help you identify with the terminology used in many other software products.
Since CS4 Adobe Photoshop Extended has had some simple 3D features through
a downloadable plug-in. Lenticular Imaging with Adobe Photoshop CS4
Extended by Russell Brown is a must read if you are interested in this subject.
However, we believe knowing why is just as important as knowing how. Through
a real example, we will go through the steps in interlacing a lenticular print
without an ad hoc program so you will also understand the "why" aspect of the
task. This is truly a project for you to make real lenticular prints on home
computers and printers.
Principle of 3D Lenticular Printing
A brief review here will help lay the foundation for further discussion.
The principle of 3D lenticular printing is based on binocular disparity. When we
view an object, our left and right eyes see a slightly different image and when
combined the brain perceives the sense of depth. In traditional printing,
information can only go left-and-right and also up-and-down. The in-and-out
information is lost. In order to perceive in-and-out, we need a way to present the
same object with a slight binocular disparity as shown in the picture on the right.
A lenticular sheet serves exactly that purpose. When a picture behind such sheet
is calculatedly sliced in such a way that some stripes will be seen by the left eye
and some will be seen by the right eye, our brain will process these images to
create the sense of depth.
If you are interested in going deeper into the theoretical aspect of this field, you
can find good articles in the References section.
Requirements
Although you can simply read through this article from the beginning to the end
and still be able to understand most of it, we do recommend that you go through
the steps to create an actual print. Knowing the nuts and bolts of how an
interlacing program works will give you the confidence to make good lenticular
prints for your future projects. On top of that, it is fun.
1. A slider bar for taking pictures along a straight line smoothly. You can
purchase a slider bar from stereoscopy. ViCGI.com is not affiliated with
this vendor and does not endorse any of their products. We only tell you
where we bought our equipment.
2. A sturdy tripod.
3. A digital camera with reasonably high resolutions, say at least 2 mega
pixels.
4. A graphics editing program such as Adobe Photoshop, GIMP (free from
open source), Ulead PhotoImpact, or COREL PaintShop Photo Pro X3.
5. A lenticular sheet with adhesive backing.
6. A cold laminator.
If your camera has a remote controlled shutter then use it. Otherwise try to make
sure the camera is not shifted downward when you press the shutter button.
For the graphics editing program we strongly recommend using GIMP because it
is totally free and it is just as powerful as Photoshop. Albeit, we will use
Photoshop in our example for the reason that it is more popular. Other programs
such as Ulead Photo Impact or Corel PaintShop Pro are good alternatives too.
Preparing the pictures
Find an object which has in-and-out distance inherently, for example, a potted
plant as in our case. You can also arrange objects so that some are closer to the
camera and some are farther away.
The idea is to take a sequence of pictures along a straight line. How many
pictures do you need to take? Here is the very simple formula.
N = RPR / RL
Looking at the picture on the right will give you a clear idea. If the printer can
print 720 lines per inch and there are 40 lenticules per inch, the formula is telling
us that under each lenticule there will be 18 lines. These 18 lines will be the
aggregate of the 18 pictures we have taken with each picture contributing one
pixel. In other words, for the final interlaced picture, column number 1, 19,
37, .........etc will come from the 1st, 19th, and 37th column of picture #1, and column
number 2, 20, 38, .........etc will come from the 2nd, 20th, and 38th column of picture
#2. In general, column number k, (k + 18), (k + 2 x 18), .........etc will come from
the kth picture.
For computer programmers who want to write Photoshop action script,
Photoshop plug-in, GIMP Script-Fu or GIMP plug-in, this information is crucial for
the interlacing algorithm. Assuming your program will present a dialog to the
users to collect the printer resolutions and number of pictures to be taken, you
will need to loop through the pictures and for each picture to loop through the
correct column intervals for extracting the stripes corresponding to the specific
picture. The pseudocode of your program will look like
Remainder = RPR % RL
IF Remainder != 0 THEN prompt user for correct number of pictures
ELSE
DO
N = RPR / RL
Steps = (Picture Width) / N
FOR i = 0 TO (N - 1)
FOR j = 1 TO (Steps - 1)
Extract column (i + j * N + 1) of picture i
Insert the extracted column into column (i + j * N + 1) of inter
laced image
END FOR j
END FOR i
END DO
END ELSE
Ideally the more pictures, the smoother the final image will be. But if you have
less than 18 pictures then you can scale down any number of pictures as long as
it is an integer.
Step 5
Once the alignment for the total 18 layers is done you will notice that layer 18
has shifted quite a lot to the right. Now you can use the [Crop] tool to resize the
picture
Step 6
Create a new file with the same width and height as the just cropped image. On
the new file, create a black and white pattern with one white stripe for every 17
black stripes. Repeat this pattern to fill in the rest of the area. The white stripes
in this file represent the columns from one of the pictures that will be used in the
final aggregated interlaced image. The black wider stripes represent the area that
will be seen through.
Step 7
Choose [Select > All] or press [Ctrl-A] to put the pattern into the clipboard.
Step 8
Turn on the visibility of each layer and create a layer mask for each of them.
Step 9
Click on the [Channel] tab on the [Layer/Channel] palette. Highlight and select
the Layer Mask layer and turn on its visibility. Temporarily turn off the visibility
of the RGB layer. Paste the content in the clipboard into the Layer Mask layer.
Use the [Magnify] tool to zoom on the left edge. Choose the [Move] tool from the
tool box if necessary to align the pattern so that the first white stripe for Layer 1
starts at column 1. Turn the visibility of the RGB layer back on and you will see
the 17-pixels apart 1-pixel stripes has been created. Repeat the same procedure
for the rest of the layers. For example, align the first white stripe of Layer 2 to
start at column2, the first white stripe of Layer 3 to start at column 3, so on and
so forth.
As the result of these steps, the final interlaced picture is shown as below.
Step 10
Merge the layers, crop it to a more suitable size and the file is ready to be printed.
Step 11
Print the file to your inkjet printer. If you use Epson, chose the Text and Picture
option from the preference dialog which maps to the 720 dpi.
Step 12
Laminate the lenticular sheet on top of the printout using a cold laminator and
voila!
Ad hoc software
What we have shown so far are the fundamentals. In reality, professionals in the
industry probably would not create lenticular prints this way. They would most
likely use ad hoc software. Listed below are some of the software we have used.
If you are software maker and would like to have your software listed here.
Please send us a fully functional copy for evaluation.
References
1. Wikipedia - Lenticular Printing
2. Wikipeida - Stereoscopy
3. LENSTAR - how it works
4. ThinkQuest - Binocular Disparity
5. USC - 3D Interaction with Autostereoscopic Displays