Images and GIFs with Laser Projectors

Images and GIFs with Laser Projectors

After some experimenting and lots of optimizing, I've been able to get laser projectors to display images and GIFs.


Tower Unite Logo (High Quality Shaders)

colorwheel
Silk Icons Color Wheel (High Quality Shaders)

epicface
Epic Face (No High Quality Shaders)

ezgif-1-850f3c1841 globe
Spinning Globe (No High Quality Shaders)

How does it work?

LOTS of if statements. If laser projectors had arrays this would be a lot easier.

The whole reason this thing works is because of these statements:

h = if( index == N , Value , h);
s = if( index == N , Value , s);
v = if( index == N , Value , v);

The above if statements will change a specific pixels HSV to a desired value, otherwise it will ignore it.
You can also combine OR operators to save some space.

h = if( index == N | index == N+1 , Value , h);

And if you want to make GIFs, you can just generate multiple image outputs and add another check for time.

h = if( index == N & (round(Speed*time) % TotalFrames) == Frame, Value, h);

Then I wrote up a script in Python that would read an image and do all the magic for me.

Is this practical for condos?

Not really. Images with extremely limited color palettes will benefit the most, while more detailed images will kill your framerate. Best case scenario (in my experimenting), you'll take a hit of around 5-10 FPS, worst case scenario, it'll be 40-50 FPS. And that's for only one image!

You also may have noticed in the spinning globe GIF, my framerate is 8 FPS. Yeah, it sucks. It’s more of a novelty than anything.

The performance hit is really dependent on how simple your image is. Less variations in color = less if statements. I guess if you use a custom made image that is really simple, you could probably pull it off.

To put it into perspective, images usually have anywhere between 1,000-8,000 characters.
GIFs can have over 500,000 characters!
And having to do these if statements every single frame does not help either. That is why it’s so laggy.

I want to try it out!

I'm not a web dev, so I can't make an online tool to generate an output. You can have my Python script though. There are some quirks with my script though, PNGs with a bit depth of 8 or lower won't work. I've also only tested it with PNGs, JPGs, and GIFs.

GitHub for the code is here.
15 Likes

Wow. That’s so dope.

2 Likes

That’s awesome.

1 Like

That’s really awesome.

1 Like

I guess it’d be nice if the scripting would get enhanced to have more programming, including arrays