-
Notifications
You must be signed in to change notification settings - Fork 0
/
GIF.html
33 lines (32 loc) · 1.84 KB
/
GIF.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<img id="image" width="100px">
<script src="/GIFEncoder.js"></script>
<script>
let a = new Uint8Array(6);
set32Int2Array(a, 0, 2, 280);
console.log(a);
let gif = new GIF(10, 10);
gif.addFrame([
[[255,0,255],[255,0,0],[255,0,0],[255,0,0], [255,0,0], [0,0,255], [0,0,255], [0,0,255],[0,0,255],[255,0,255]],
[[255,0,0],[255,0,0],[255,0,0],[255,0,0], [255,0,0], [0,0,255], [0,0,255], [0,0,255],[0,0,255],[0,0,255]],
[[255,0,0],[255,0,0],[255,0,0],[255,0,0], [255,0,0], [0,0,255], [0,0,255], [0,0,255],[0,0,255],[0,0,255]],
[[255,0,0],[255,0,0],[255,0,0],[255,255,255], [255,255,255], [255,255,255], [255,255,255], [0,0,255],[0,0,255],[0,0,255]],
[[255,0,0],[255,0,0],[255,0,0],[255,255,255], [255,255,255], [255,255,255], [255,255,255], [0,0,255],[0,0,255],[0,0,255]],
[[0,0,255],[0,0,255],[0,0,255],[255,255,255], [255,255,255], [255,255,255], [255,255,255], [255,0,0],[255,0,0],[255,0,0]],
[[0,0,255],[0,0,255],[0,0,255],[255,255,255], [255,255,255], [255,255,255], [255,255,255], [255,0,0],[255,0,0],[255,0,0]],
[[0,0,255],[0,0,255],[0,0,255],[0,0,255], [0,0,255], [255,0,0], [255,0,0], [255,0,0],[255,0,0],[255,0,0]],
[[0,0,255],[0,0,255],[0,0,255],[0,0,255], [0,0,255], [255,0,0], [255,0,0], [255,0,0],[255,0,0],[255,0,0]],
[[255,0,255],[0,0,255],[0,0,255],[0,0,255], [0,0,255], [255,0,0], [255,0,0], [255,0,0],[255,0,0],[255,0,255]]
]);
let out = gif.render();
console.log(out);
document.getElementById("image").src= URL.createObjectURL(out);
console.log(gif);
</script>
</body>
</html>