I am trying to interlace 2 or 3 images and make them to look it pixels. How do I first interlace the 2 or 3 images and then divide the final image to pixels?
What do you mean by ‘interlace’?
I really don’t know if I understand what you want to do with the image…
I made an attempt below, see if it is useful in any way or if it has nothing to do with the goal (?):

im = ColorConvert[image, "RGB"];
a = Delete[Map[RGBColor[#] &, Tuples[{1, 0}, 3]], {{1}, {-1}}];
a1 = ColorQuantize[im, a];
swap = {a[[1]] -> a[[3]], a[[3]] -> a[[1]], a[[2]] -> a[[5]],
a[[5]] -> a[[2]], a[[4]] -> a[[6]], a[[6]] -> a[[4]]};
rule = {RGBColor[{1, 1, 0}] -> Black, RGBColor[{1, 0, 1}] -> Black,
RGBColor[{0, 1, 1}] -> Black};
left = ColorReplace[a1, rule];
right = ColorReplace[ColorReplace[a1, swap], rule];
{Grid[{{"", "left", ""}, {Black, Green, Black}, {Red, Black, Blue}},
Frame -> All],
Grid[{{"", "right", ""}, {Red, Black, Blue}, {Black, Green, Black}},
Frame -> All]}
{{"left", Show[left, ImageSize -> Medium]}, {"right",
Show[right, ImageSize -> Medium]}}
A small sample with the same pixel range for the two images:
interval = {484175 ;; 484185}[[1]];
{PixelValue[left, {All, All}][[interval]],
Map[RGBColor[#] &, PixelValue[left, {All, All}][[interval]]]}
{PixelValue[right, {All, All}][[interval]],
Map[RGBColor[#] &, PixelValue[right, {All, All}][[interval]]]}
Sorry if I couldn’t help you (I think maybe I really couldn’t understand)..
Claudio Chaib
Thank you very much for the effort. What I wanted to do is design an auto-stereoscopic image by image partitioning into equal parts and mixing the two or three images that will do two or three-flip, or Multi-flip to create a smooth 3D animation effects using lenticular printing and lenticular lenses or lenticular displays.
I hope this explains it.
You may check the attached document for further visual explanation
Lenticular.pdf (2.17 MB)
Hi Peter,
I think you need ImagePartition:
{img1, img2} = ExampleData /@ {{"TestImage", "Lena"}, {"TestImage", "Mandrill"}};
(* decomposition of images into strips: *)
{ip1, ip2} = ImagePartition[#, {512, 8}] & /@ {img1, img2};
(* odd strips of img1: *)
stp1 = Table[ip1[[n]], {n, 1, Length[ip1], 2}];
(* even strips of img2: *)
stp2 = Table[ip2[[n]], {n, 2, Length[ip1], 2}];
ImageAssemble[Riffle[stp1, stp2]]
Henrik Schachner,
Thank you very much. So what does this {512, 8} in " {ip1, ip2} = ImagePartition[#, {512, 8}] & /@ {img1, img2};" in script means? Is it Lines per Inch?
Hi Peter,
the documentation on ImagePartition states: Those units are pixels.
Henrik,
How do you make the image partition and assemble take on shapes like circles or squares or hexagonal, instead of a straight line? Also, how do you assemble more than two images like creating 3+ interlaced images? I am trying to create 2D and 3D interlaced images to the size of thin-film micro-lens so that I can create animated images when I put the thin film micro-lens over the assembled images.
Peter, using ImagePartition you can decompose images only into rectangles. For more complex shapes you probably have to use masks. The documentation gives many helpful examples! What did you try so far? Where is your code?



