MAG1K-EYE
"A Retro Way of Looking at the World"
Welcome back to the 90's and to the world of 3D illusions.
This time, you can make your own pictures... with MAG1K EYE
An autostereogram creator made in PICO-8 using less than 1K (1,024) compressed bytes of code, for #Pico1k Jam 2023.
If you create something, please tag it with #Mag1kEye or #Pico1k 🤓🤳
TOOLBAR BUTTONS
Switch to Drawing mode | |
Switch to Circle drawing shape | |
Switch to Square drawing shape | |
Generate Autostereogram | |
Download Image | |
Undo/Redo last step | |
Clear entire canvas |
CONTROLS (MOUSE KEYBOARD)
Move Brush | 🖱️ Mouse Move |
Paint | 🖱️ Mouse Left-Click |
Pick Layer/Color | 🖱️ Mouse Right-Click |
Increase/Decrease Draw Size | 🖱️ Mouse Scroll-wheel |
Closer Layer/Color | ⬆️ Up Arrow |
Farther Layer/Color | ⬇️ Down Arrow |
Increase Draw Size | ➡️ Right Arrow |
Decrease Draw Size | ⬅️ Left Arrow |
Switch Draw/Stereogram Mode | X |
Undo/Redo last step | Z |
FEATURES
- ️🖌️ Paint & Render your own "8-bit" Autostereogram
- 🖱️ Designed for Mouse Keyboard use
- ↩️ Undo/Redo (one level)
- 🖼️ Download finished image (or your source drawing)
- 🎞️ 60 FPS
HOW TO VIEW
- Relax your eyes and allow them to diverge, as if looking through the screen at something much farther away.
- The two black guide circles at the bottom of the image should become three dots, with the middle one in focus.
- Then the hidden 3D image should appear.
ACKNOWLEDGEMENTS
- Stereogram by gearfo - HUGE credit for source of P8 port of original autostereogram code
(I only made minor optimisations, using newer P8 API/refactoring for bytes) - Displaying 3D Images: Algorithms for Single Image Random Dot Stereograms
Original algorithm that above port was based on - Shrinko8 by thisismypassword - for shrinking code/removing comments
- ICONS8 - for toolbar buttom icons
REFERENCES/LINKS
- Autostereogram (Wikipedia)
- Gary Beene's Stereogram Information Center - Stereograms
- How to Generate Your Own Magic Eye Stereograms Online
- Stereogram solver
SOURCE CODE (938 Compressed Bytes)
function _init()palt(0,false)𝘣=0c=4g=20s=g*2.5a=1/3j=5𝘤=3n=1x=1i=true poke(24365,1)w()end function _update60()l=peek(24448)r=false if(btnp(❎))i=not i r=true if(l==1and not i)i=true r=true if(l==4and i)i=false r=true if r then if(i)memcpy(0,32768,8192)w()else memcpy(32768,0,8192)m() end if(i)p()else q() poke(24448,0)end function b()if(l==5)extcmd"screen" end n=1e=5function w()pal(15,0)?"⁶!5f100█ˇ5●?70☉" end function p()f=stat(32)d=stat(33)if(btnp(➡️))e =1 if(btnp(⬅️))e-=1 e=mid(3,e stat(36),20)if(btnp(⬆️))n =1 if(btnp(⬇️))n-=1 n=mid(n,6)if(l==2)x=1 if(l==3)x=2 if(btnp(🅾️)or l==6)memcpy(32768,0,8192)poke(24405,0)memcpy(0,40960,8192)poke(24405,96)memcpy(40960,32768,8192) if(l==7)poke(24405,0)cls()poke(24405,96) if stat(34)>0then if stat(34)>1then n=sget(f,d)else if(not h)h=true memcpy(40960,0,8192) u=true poke(24405,0)if(x==1)circfill(f,d,e,n)else rectfill(f-e,d-e,f e,d e,n) poke(24405,96)end else if(h)h=false u=false end spr(0,0,0,16,16)b()if(x==1)circfill(f,d,e,n)circ(f,d,e,u and 6or 8)else rectfill(f-e,d-e,f e,d e,n)rect(f-e,d-e,f e,d e,u and 6or 8) ?n,f-1,d-2 end function m()v=flr(rnd(15))-15for e=1,6do pal(e,e v,1)end y(j)end function q()spr(0,0,0,16,16)b()end function y(e)if(e<2)e=2 if(e>16)e=16 local n,f,d=k(0)for d=0,127do o={}for e=0,127do o[e]=e end for i=0,127do local n=sget(i,d)if(n>8)n=8 n=n/c local f=k(n)local e=flr(i-f/2)local f,t=e f,false if 0<=e and f<128then t=false local l=1while true do local e=n 2*(2-a*n)*l/(a*s)z=sget(flr(i-l),d)/c 𝘢=sget(flr(i l),d)/c t=z<e and 𝘢<e l =1if(not t or e>=1)break end if t then local n=o[e]while n~=e and n~=f do if(n<f)e=n n=o[e]else o[e]=f e=f n=o[e]f=n end o[e]=f end end end for n=127,0,-1do if(o[n]==n)sset(n,d,rnd(e))else sset(n,d,sget(o[n],d)) end end poke(24405,0)circfill(64-n/2,123,3,0)circfill(64 n/2,123,3,0)poke(24405,96)end function k(e)return flr((1-a*e)*s/(2-a*e) .401)end
Status | Released |
Category | Tool |
Platforms | HTML5 |
Rating | Rated 5.0 out of 5 stars (4 total ratings) |
Author | Paul Nicholas (Liquidream) |
Made with | PICO-8 |
Tags | autostereogram, magic-eye, pico1k, PICO-8 |
Comments
Log in with itch.io to leave a comment.
Amazing. I would never have thought of something like this. Very cool.
You combined two things I love: PICO-8 and Stereograms. Thanks for making this.
Awesome work and very nostalgic!