Notebook - Welcome to Notebook

Contact/Report Bugs
You can contact me at: bkenwright@xbdev.net












Generating 3D magical images with hidden patterns graphics ref https www hidden 3d com meta charset utf 8 meta content width device width initial scale 1 name viewport h1 Stereogram Demo h1 section canvas id canvas width 400 height 400 style width 400px Sorry your browser doesn t support HTML5 Canvas canvas img id stereogram width 400 height 400 style display none src div class buttons form name brush style display none div class brush swatches Brush Density input name value type radio class brush value id brush 100 value 100 label for brush 100 label input name value type radio class brush value id brush 75 value 75 label for brush 75 label input name value type radio class brush value id brush 50 value 50 label for brush 50 label input name value type radio class brush value id brush 25 value 25 label for brush 25 label input name value type radio class brush value id brush 0 value 0 label for brush 0 label div div class brush sizes Brush Size input name size type radio class brush size id sm brush value 10 label for sm brush label input name size type radio class brush size id md brush value 20 label for md brush label input name size type radio class brush size id lg brush value 40 label for lg brush label div form div class clearfix div button id show stereogram Show Stereogram button button id show canvas Show Depth Map button button id redraw Redraw Shapes button button id draw mode Draw Your Own button button id back to shapes style display none Back to Shapes button button id clear style display none Clear button div section section hr hr p Stereogram example written in JavaScript for generating stereogram images in the browser p p In the above example pixel values from an HTML5 Canvas are turned into depth data which are then used to generate a stereogram image The code looks something like this p pre var canvas document getElementById canvas Stereogram render el stereogram depthMapper new Stereogram CanvasDepthMapper canvas pre section script type text javascript src https tony pizza github io Stereogram js stereogram js script script type text javascript src https tony pizza github io Stereogram js depthmappers CanvasDepthMapper js script script function var canvas document getElementById canvas context this canvas getContext 2d stereogram document getElementById stereogram drawMode false showingStereogram false window addEventListener resize resize false document getElementById show stereogram onclick function renderStereogram canvas style display none stereogram style display block document getElementById show stereogram style display none document getElementById show canvas style display inline showingStereogram true document getElementById show canvas onclick function stereogram style display none canvas style display block document getElementById show stereogram style display inline document getElementById show canvas style display none showingStereogram false document getElementById redraw onclick function redraw if showingStereogram renderStereogram document getElementById clear onclick function clear if showingStereogram document getElementById show canvas click for var i 0 i document brush value length i document brush value i onchange function brush value Math ceil parseInt getRadioVal document brush value 255 100 for var i 0 i document brush size length i document brush size i onchange function brush size parseInt getRadioVal document brush size function getRadioVal form name if typeof form elements name value undefined return form elements name value var val radios form elements name for var i 0 i radios length i if radios i checked val radios i value break return val function renderStereogram Stereogram render el stereogram colors generatePalette 10 depthMapper new Stereogram CanvasDepthMapper document getElementById canvas function randomRGBa return Math floor Math random 256 Math floor Math random 256 Math floor Math random 256 255 function generatePalette numColors var palette for var i 0 i numColors i palette push randomRGBa return palette function redraw var fill i width canvas width height canvas height shapes 5 shade 255 shapes clear for i shapes 1 i 0 i fill Math round shade i context fillStyle rgb fill fill fill context beginPath context moveTo Math floor Math random width Math floor Math random height context lineTo Math floor Math random width Math floor Math random height context lineTo Math floor Math random width Math floor Math random height context fill function clear context fillStyle ffffff context fillRect 0 0 canvas width canvas height function resize stereogram width canvas width window innerWidth 400 400 window innerWidth redraw drawing code document getElementById draw mode onclick function drawMode true canvas style border 1px solid aaa document getElementById redraw style display none this style display none var clearBtn document getElementById clear clearBtn click clearBtn style display inline document brush style display inline document getElementById back to shapes style display inline document getElementById back to shapes onclick function drawMode false canvas style border none document getElementById redraw style display inline this style display none var clearBtn document getElementById clear clearBtn click clearBtn style display none document brush style display none document getElementById draw mode style display inline redraw document getElementById show stereogram click var px py drawing false x 0 y 0 var brush value 0 size 10 opacity 0 5 function draw x y w v a if drawMode return var gradient context createRadialGradient x y 0 x y w gradient addColorStop 0 rgba v v v a gradient addColorStop 1 rgba v v v 0 context beginPath context arc x y w 0 2 Math PI context fillStyle gradient context fill context closePath canvas onmousedown function e if drawMode return drawing true px e pageX canvas offsetLeft py e pageY canvas offsetTop draw px py brush size brush value brush opacity document body onmouseup function if drawMode return drawing false canvas onmousemove function e if drawMode return if drawing x e pageX canvas offsetLeft y e pageY canvas offsetTop var dis Math sqrt Math pow px x 2 Math pow px y 2 for var i 0 i dis i var s i dis draw px s x 1 s py s y 1 s brush size brush value brush opacity px x py y resize document brush size 2 click document brush value 4 click document getElementById show stereogram click script

efined return form elements name value var val radios form elements name for var i 0 i radios length i if radios i checked val radios i value break return val function renderStereogram Stereogram render el stereogram colors generatePalette 10 depthMapper new Stereogram CanvasDepthMapper document getElementById canvas function randomRGBa return Math floor Math random 256 Math floor Math random 256 Math floor Math random 256 255 function generatePalette numColors var palette for var i 0 i numColors i palette push randomRGBa return palette function redraw var fill i width canvas width height canvas height shapes 5 shade 255 shapes clear for i shapes 1 i 0 i fill Math round shade i context fillStyle rgb fill fill fill context beginPath context moveTo Math floor Math random width Math floor Math random height context lineTo Math floor Math random width Math floor Math random height context lineTo Math floor Math random width Math floor Math random height context fill function clear context fillStyle ffffff context fillRect 0 0 canvas width canvas height function resize stereogram width canvas width window innerWidth 400 400 window innerWidth redraw drawing code document getElementById draw mode onclick function drawMode true canvas style border 1px solid aaa document getElementById redraw style display none this style display none var clearBtn document getElementById clear clearBtn click clearBtn style display inline document brush style display inline document getElementById back to shapes style display inline document getElementById back to shapes onclick function drawMode false canvas style border none document getElementById redraw style display inline this style display none var clearBtn document getElementById clear clearBtn click clearBtn style display none document brush style display none document getElementById draw mode style display inline redraw document getElementById show stereogram click var px py drawing false x 0 y 0 var brush value 0 size 10 opacity 0 5 function draw x y w v a if drawMode return var gradient context createRadialGradient x y 0 x y w gradient addColorStop 0 rgba v v v a gradient addColorStop 1 rgba v v v 0 context beginPath context arc x y w 0 2 Math PI context fillStyle gradient context fill context closePath canvas onmousedown function e if drawMode return drawing true px e pageX canvas offsetLeft py e pageY canvas offsetTop draw px py brush size brush value brush opacity document body onmouseup function if drawMode return drawing false canvas onmousemove function e if drawMode return if drawing x e pageX canvas offsetLeft y e pageY canvas offsetTop var dis Math sqrt Math pow px x 2 Math pow px y 2 for var i 0 i dis i var s i dis draw px s x 1 s py s y 1 s brush size brush value brush opacity px x py y resize document brush size 2 click document brush value 4 click document getElementById show stereogram click script

3dplot
a4print
about
acejs
acejs2
acejs3
aessecurity
angularjs
animbackgroundimage
aseformat
assert
asteroidsjs
backgrounds01
backgrounds02
backgrounds03
barnsleyfern
base26
base64
bib
binary
bodypix
bouncy
box2dweb
breakoutjs
browserversion
buslanes
busybutton
bvhreader
calendar
candycrush
candycrush2
canvas
canvas2
canvas3
canvasmandelbrot
canvasmandelbrot2
canvasnumbers
canvaszoom
capsule
changingimages
chaosgame
chaosrandom
chaosrandomhisto
chaosrandomhisto2
chatgptusingopenai
chatgptusingopenai2
chatgptusingopenai3
checkboxtoggle
chinesetiles
classes
classfeatures
clipboardbutton
clonenode
codedropdown
codemirror
codemirror2
collada
colorpick
columnresizer
contextmenu
convnet
cookiebanner
countdown
countdown2
countdown3
crop
css3dbarchart
css3dbarchart2
css3dbook
css3dscene
csscube
csscube2
csscube3
csscubevideos
cssfilelist
csshas
csspulse
cssresizeaspect
cssspin
csszooming
csvtoarray
curleffect
customcheckbox
d3datamap
d3js
d3js10
d3js11
d3js2
d3js3
d3js4
d3js5
d3js6
d3js7
d3js8
d3js9
d3jsanimatedgrid
d3jsarctransition
d3jsarctransition2
d3jsaxis
d3jsaxischanging
d3jsbars
d3jsbrushing
d3jsbuslanes
d3jsbuslanes2
d3jscalendar
d3jscheat
d3jsclock
d3jscloudmap
d3jscogs
d3jscolors
d3jscovid
d3jscovid2
d3jscovid3
d3jsdashboard
d3jsdashboard2
d3jsdashboard3
d3jsdatakeyfunction
d3jsdensity
d3jsdragresizing
d3jsdragresizing2
d3jseach
d3jsease
d3jsevents
d3jsflower
d3jsforcegroups
d3jsforces
d3jsforces2
d3jsfractaltree
d3jsgeo
d3jsgroupbars
d3jsgroups
d3jsheatmap
d3jshex
d3jshierarchies
d3jshierarchies2
d3jshistogram
d3jshistogram2
d3jshistogram3
d3jshistogram4
d3jsinterpolate
d3jsjoin
d3jskmean
d3jskmean2
d3jsline
d3jsline2
d3jsline3
d3jsline4
d3jslinetransition
d3jslinetransition0
d3jslinetransition2
d3jsmaplocations
d3jsmaps
d3jsmaps2
d3jsmaps3
d3jsmisc
d3jsmisc2
d3jsmodule
d3jsmodulecolor
d3jsmultistyles
d3jsnobel
d3jsoverlappinggraphs
d3jspanel
d3jspie
d3jspieinterpolate
d3jssankey
d3jssankey2
d3jsscatter
d3jsshapes
d3jsslider
d3jsspending
d3jsspending2
d3jsspiralplot
d3jsspirograph
d3jssquare
d3jsstack
d3jsstackedbar
d3jsstackedbar2
d3jssunburst
d3jssunmoon
d3jssvglines
d3jssymbols
d3jstimelines
d3jsuk
d3jsvoronoi
d3scatterplot
d3timeline
d3timeline2
datalist
datamuse
date
dblclickhighlight
deviceorientation
dictionaryapi
dockermenu
doodlepad
downloadgif
dragdroplistitems
dragrotateresizediv
dragrotateresizediv2
dragrotateresizediv3
dragrotateresizediv4
dragrotateresizefontsize
dragselectbrush
drawlinesdiv
dropdown
dualquaternionimages
dynamicgrid
easefunctions
easeinterpolate3dplots
echart
echart2
echart3
encapsulation
epubviewer
errorstack
excalidraw
excalidraw2
excalidraw3
excalidraw5
expandable
faker
fetchplus
fileupload
fixedtopbar
fluiddynamics
fluiddynamics2
fluiddynamics3
fluidsmokedynamics
fluidsmokedynamics2
fonts
fonts2
footerbar
fractalmaze
fractalmaze2
fractalnoiseimage
fractals
fractals2
fractaltree
freesvg
fresnel
froggerjs
gantt
gifgiphyapi
gifhex
gltffromscratch
gradients
griditems
griditems2
griditems3
griditems4
gridworms
heat
hexview
hexview2
highlight
icons
icons2
iframes
ik
imagetracertosvg
imgur
inputfile
invadersjs
ipynb
ipynb2
ipynb3
ipynb4
isbn13
isbn2
jpghex
jquery
jquery2
jqueryui
jqueryui2
jsdraganddrop
jsfire
jslint
jsobfuscate
jsraytracer
jstree
jstree2
jszip
jszipimages
jszipread
keyframes
l2dwidget
lda
leftmenu
less
less2
lineargradientimage
linenumbers
loadimagefromfile
makepdf
maps
markdown
markdown2
markdownalerts
markdownalerts2
markdownbookmarks
markovimage
markovpixelblocks
mathjax
matrices
matsandvects
mazegamejs
md2tex
metrotiles
metrowindows
milestones
minkowski2dboxes
misc
misc2
modules
myipdetails
neataptic
networkstructures
networkstructures2
number
obj
objtojson
openaiimages
opencv
opencv2
opencv3
opencv4
opencv5
outline
p2
p5fractalleaf
p5fractalshape
p5js
p5js2
p5js3
p5jsanimatedcover
p5mengercube
p5snowflakes
palindrome
panel
parallax
paste
paste2
pasteimgfromurl
pdfjs
pdfjs2
pdfkit
pdfkit2
pdfkit3
pdfkit4
pdfkit5
pdfkit6
pdfmake
pdfmake2
pdfmake3
pdfmake4
pdfmake5
pdfmake6
perlin
perlin2
perlin3
perspective
pexels
playground
plotly
plotlynoise
plotlyranddist
plyloader
plyloader2
pngtxtencoder
pongjs
pptxgenjs
prettycode
prism
prn
problems
progress
pseudorandom
px2svg
python
quotes
racergame
random
randomcalcpie
randomgenerator
randomprofilepatterns
randomsinhistogram
randomstring
rating
rayambient
raymonte
raymonteprogressive
raymonteprogressive2
raymontewarmstart
reexpcross
reexpcross2
regex
regexbib
regexpfixbib
regexpmultiline
repeatwordsregexp
resizabletable
resizabletable2
revealjs
revealjs2
revealjsmulti
ritalanguage
ritalanguage2
ritalanguage3
rotateimg
rough
rsapublicprivatekeys
rss
rss2
sankey
scrappingsvg
scrolltext
scrolltext2
scrollwidth
sdfboxinboxtwist
sdfhollowbox
setintervalexception
shareurl
shuffle
sidecomment
similarity
simplehighlighter
simpleplatformgamejs
sinecanvas
sliderpopout
slides
smileys
snowfall
snowman
sound
soundsignal
sphererayintersection
springs
sqljs
steganography
stereogram
stringmatching
svg
svgchaos
svgdragresize
svgdragresize2
svgdragresize3
svgdragrotate
svgdrawing
svglines
svglines2
svglines3
svglines4
svglines5
svglinesmandelbrot
svgpathsdragrotate
svgpathsdragrotateresize
svgpie
svgpie2
svgpie3
svgpiepath
svgpiepath2
svgrandomfaces
symbols
synaptic
synaptic2
synonyms
tablerotatecells
tablerotatecells2
tablerotatecells3
tablerotatecells3b
tablerotatecells4
tables
tablezebra
tabularjs
tabularjs2
tabulatordownload
tagcanvas
tensorflowgan
tensorflowjs
tensorflowjsbasic
tensorflowjscnn
tensorflowjssinewave
tensorflowjssound
tensorflowmobilenet
tetrahedronfractal
tetrahedronfractalfolding
tetris
textarea
textareaauto
textareadiv
textareadiv2
textmaskimage
theirorthere
thesaurus
threejs
threejs2
threejs3
threejs4
threejsgltf
threejstokyo
tiles
toaster
tooltip
transition
transitionexpandabledropdown
treeview
treeview2
tricks
tshirt
tshirt2
tshirt3
turningpages
unsplash
urlblob
urlblob2
userdefinepoints
vector
videos
videos2
visualsort
vue
w2ui
w2uientertextdialog
webcam
webgl
webgl2
webgl3
webgl4
webgl5
webglbasic1
webglbasic2
webglcube
webglfov
webglfrustum
webgljson
webglleaves
webgllighting
webglorthographic
webglpoints1
webglpoints2
webglpoints3
webglsquare
webgltexture1
webgltexture2
webgltexture3
webgltransforms
webgltriangle
webgpu
webgpu10
webgpu11
webgpu12
webgpu13
webgpu14
webgpu15
webgpu16
webgpu17
webgpu2
webgpu3
webgpu4
webgpu5
webgpu6
webgpu7
webgpu8
webgpu9
webgpubars
webgpubuffers
webgpubuffers2
webgpucellnoise
webgpuclouds
webgpuclydescope
webgpucompute
webgpucubemap
webgpucubemap2
webgpudeferred
webgpudepth
webgpudof
webgpudrops
webgpuetha
webgpufire
webgpufractalcubes
webgpuglassrain
webgpugltf
webgpugltf2
webgpugrass
webgpugrid
webgpukernel
webgpukleinian
webgpulabupdates
webgpulighting
webgpumandelbrot
webgpumeta3d
webgpumetaballs
webgpumouse
webgpunoise
webgpunormalmapping
webgpuobj
webgpuparallax
webgpuparallax2
webgpuparallax3
webgpuparallaxshadow
webgpuparallaxshadow2
webgpupixel
webgpuquad
webgpuray1
webgpuraytracing
webgpuraytracing2
webgpushadowmaps
webgpushadowmaps2
webgpusierpinski2d
webgpusierpinski3d
webgpusinusoid
webgpussao
webgpustadiumobj
webgpuswirl
webgputestpipe3
webgputoon
webgputopology
webgputt
webgpuvolcloud
webgpuwater
webgpuwireframe
webgpuwireframe2
webpcanvas
webworkers
webxr
webxr2
wiggly
wikipedia