Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
26 lines (23 loc) · 1001 Bytes

File metadata and controls

26 lines (23 loc) · 1001 Bytes
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<html lang="en">
<head>
<title>ImageScript Example</title>
</head>
<body>
<h1>ImageScript example</h1>
<p>Simple example showing integration of ImageScript into an application (load image, modify, encode, convert to blob,
display)</p>
<p>You can find more examples on <a href="https://github.com/matmen/ImageScript/tree/master/tests">GitHub</a></p>
<img alt="ImageScript Example Result" id="image" src="https://via.placeholder.com/100x100">
<script src="https://cdn.jsdelivr.net/gh/matmen/imagescript@browser/browser/ImageScript.js"></script>
<script>
(async () => {
const avatar = await fetch('https://raw.githubusercontent.com/matmen/ImageScript/master/tests/targets/readme.png').then(r => r.arrayBuffer());
const image = await ImageScript.Image.decode(avatar);
image.saturation(0);
const encoded = await image.encode();
const blob = new Blob([encoded], {type: 'image/png'});
document.querySelector('#image').src = URL.createObjectURL(blob);
})();
</script>
</body>
</html>
Morty Proxy This is a proxified and sanitized view of the page, visit original site.