forked from snorpey/jpg-glitch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
48 lines (48 loc) · 3.12 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>image glitch experiment</title>
<link rel="stylesheet" href="styles/main.css" />
</head>
<body>
<article class="content intro">
<h1 class="headline">glitch images</h1>
<p>drag an image into the browser window to modify it. this script corrupts some bytes in a jpg image. because of the way <a href="https://en.wikipedia.org/wiki/JPEG">jpg</a> encoding works, the corrupted file still shows something. inspired by <a href="http://github.com/soulwire">soulwire</a>s <a href="http://blog.soulwire.co.uk/laboratory/flash/as3-bitmapdata-glitch-generator">experiment</a> in flash. this experiment was created by <a href="http://fishnation.de/">georg</a>. you can follow him on <a href="https://twitter.com/snorpey">twitter</a> or explore the source code on <a href="https://github.com/snorpey/jpg-glitch">github</a>.</p>
<p>if you like this one, you can check out some of his other <a href="http://snorpey.github.io/experiments/">javascript experiments</a>.</p>
</article>
<div class="content" id="controls">
<div class="control-wrapper">
<label class="control-label" for="amount-slider">amount</label>
<input class="control-input control-number" id="amount-number" type="number" min="0" max="99" value="50" maxlength="2" />
<input class="control-input control-slider" id="amount-slider" type="range" min="0" max="99" value="50" step="1" maxlength="2" />
</div>
<div class="control-wrapper">
<label class="control-label" for="seed-slider">seed</label>
<input class="control-input control-number" id="seed-number" type="number" min="0" max="100" value="50" maxlength="2" />
<input class="control-input control-slider" id="seed-slider" type="range" min="0" max="100" value="50" step="1" maxlength="2" />
</div>
<div class="control-wrapper">
<label class="control-label" for="iterations-slider">iterations</label>
<input class="control-input control-number" id="iterations-number" type="number" min="1" max="50" value="5" maxlength="2" />
<input class="control-input control-slider" id="iterations-slider" type="range" min="1" max="50" value="5" step="1" maxlength="2"/>
</div>
<div class="control-wrapper">
<label class="control-label" for="quality-slider">quality</label>
<input class="control-input control-number" id="quality-number" type="number" min="1" max="99" value="50" maxlength="2" />
<input class="control-input control-slider" id="quality-slider" type="range" min="1" max="99" value="50" step="1" maxlength="2" />
</div>
<button id="random-button" class="button is-hidden">randomize</button>
</div>
<div class="export-wrapper">
<button id="import-button" class="button">import image</button>
<input type="file" id="import-input" accept="image/*" />
<button id="save-button" class="button">export image</button>
<a id="png-button" download="glitched-image.png" target="_blank" class="download-link">download bitmap file<span> (.png)</span></a>
</div>
<div class="canvas-wrapper">
<canvas id="canvas" />
</div>
<script src="scripts/lib/require-2.1.4.js" data-main="scripts/main"></script>
</body>
</html>