Platform
Solutions
Resources
Pricing
Sign in
Sign up
Fil
Vocateur.
Workspace
Fork
Public
2 collections
By
Fil
Edited
Feb 5, 2023
1 fork
9 stars
2
Insert cell
Insert cell
QOI
=
(
await
import
(
"https://esm.sh/qoijs@1.0.0"
)
)
.
default
Insert cell
test
=
{
const
width
=
testcard
.
naturalWidth
;
const
height
=
testcard
.
naturalHeight
;
const
im
=
DOM
.
context2d
(
width
,
height
,
1
)
;
im
.
drawImage
(
testcard
,
0
,
0
)
;
return
{
...
im
.
getImageData
(
0
,
0
,
width
,
height
)
,
width
,
height
}
;
}
Insert cell
encoded
=
QOI
.
encode
(
test
.
data
,
{
width
:
test
.
width
,
height
:
test
.
height
,
channels
:
4
,
colorspace
:
0
}
)
Insert cell
image_qoi
=
new
Blob
(
[
encoded
]
,
{
type
:
"image/qoi"
}
)
// download and save as testcard.qoi
Insert cell
compressed
=
FileAttachment
(
"testcard.qoi"
)
.
arrayBuffer
(
)
Insert cell
decoded
=
QOI
.
decode
(
compressed
)
Insert cell
Insert cell
decoded
.
data
.
some
(
(
d
,
i
)
=>
d
!==
test
.
data
[
i
]
)
?
md
`🪳 **failure**!`
:
md
`👍 it works!`
Insert cell
testcard
=
FileAttachment
(
"testcard.png"
)
.
image
(
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
One platform
to build and deploy the best data apps
Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Try it for free
Learn more
Fork
View
Export
Listed in...
Image
Fil
Hello
Fil
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
QOI
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
test
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
encoded
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
image_qoi
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
compressed
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
decoded
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
testcard
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
reset
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML