http://peterjsucy.blogspot.com/2008/12/how-does-lenticular-printing-work.html

http://peterjsucy.blogspot.com/2008/12/how-does-lenticular-printing-work.html

Inspiration

90s lenticular trend

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4a950f84-b462-4935-b9cb-85426302013b/693CjU0.gif

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f9048c0b-ac51-485d-87c0-83c7625bfb12/ezgif.com-gif-maker_(2).gif

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8e56e597-6184-4eb9-b2a5-98463042fb37/images.jpeg

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4a8a6c42-95b7-40aa-badf-8fef4bb3c638/8a95d18e8d4dca2b124b948ca76c6065.gif

How it works irl

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e38ba6ca-1f39-4d7a-9d13-ffba08fb3be0/330px-Close_up_of_the_surface_of_a_lenticular_print.jpg

https://www.explainthatstuff.com/lenticularprinting.html

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/fbda4e98-474e-43a2-bd9b-1fc877b614d9/howlenticular3.png

Recreating that with pixels

We manipulated the RGB values of each pixel columns as the RGB value of the three images in different ratios for each point of view.

pixels[i + 0] = (tex.pixels[i + 0] * 126 / 255) + (man.pixels[i + 0] * 26 / 255) + (c * 103 / 255)
pixels[i + 1] = (tex.pixels[i + 1] * 126 / 255) + (man.pixels[i + 1] * 26 / 255) + (c * 103 / 255)
pixels[i + 2] = (tex.pixels[i + 2] * 126 / 255) + (man.pixels[i + 2] * 26 / 255) + (c * 103 / 255)

pixels[i1 + 0] = (tex.pixels[i1 + 0] * 140 / 255) + (col.pixels[i1 + 0] * 115 / 255)
pixels[i1 + 1] = (tex.pixels[i1 + 1] * 140 / 255) + (col.pixels[i1 + 0] * 115 / 255)
pixels[i1 + 2] = (tex.pixels[i1 + 2] * 140 / 255) + (col.pixels[i1 + 0] * 115 / 255)

pixels[i2 + 0] = (tex.pixels[i2 + 0] * 160 / 255) + (man.pixels[i2 + 0] * 47 / 255) + (col.pixels[i2 + 0] * 48 / 255)
pixels[i2 + 1] = (tex.pixels[i2 + 1] * 160 / 255) + (man.pixels[i2 + 1] * 47 / 255) + (col.pixels[i2 + 1] * 48 / 255)
pixels[i2 + 2] = (tex.pixels[i2 + 2] * 160 / 255) + (man.pixels[i2 + 2] * 47 / 255) + (col.pixels[i2 + 2] * 48 / 255)

We started with changing the Alpha values of the images instead of rendering the canvas - it didn't go down too well.

man.pixels[i+3] = 26;
tex.pixels[i+3] = 0;
col.pixels[i+3] = 126;

https://editor.p5js.org/rajshree.s/sketches/gObxzxREi - didn't work

The image would disappear after a few seconds. We spend a few days and a billion ways to fix it.

trust me, you do not want to go through it all

trust me, you do not want to go through it all

Finally, the Coding Lab helped 🙏

https://editor.p5js.org/rajshree.s/sketches/InyMnE65y - Previous draft with mouseX

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c2a75a0b-bd55-4746-892a-2d3c83fb61b3/ezgif.com-gif-maker_(3).gif