Platform
Resources
Pricing
Sign in
Contact us
Sylvain Lesage
Software engineer at Hugging Face. Prototyping here with JS, d3, three.js.
Workspace
Fork
Published
2 collections
By
Sylvain Lesage
Edited
Feb 28, 2020
4 stars
Image
Download the shape of a country
Input: draw points on image
Canvas equality by value
Input: Draw an arrow on an image
Calibrate a Three.js camera using fSpy
Hello fSpy
Main Colors from Image
Colors palette from image
Can I Use Media Fragments?
Hello Cloudinary Upload
Color by number
Pixel-art or Voronoi image tesselation
Hello pixelit
Input: draw a box on image
Extended drawImage
drawImage respects canvas transparency
CSS object-fit formulas
object-fit
Every Other Pixel Is A Line
Fake video player
Async image loading, and CORS
Preload a list of images
Image placeholder
Image cover
Identify images with deterministic UUID
Perspective rectifier - example
Perspective rectifier
Also listed in…
Network, cache and memoization
Insert cell
Insert cell
html
`<img src="${
src
}" style="max-width: 300px" />`
Insert cell
Insert cell
Insert cell
afterOnload
=
src
=>
new
Promise
(
(
resolve
,
reject
)
=>
{
const
img
=
new
Image
(
)
;
img
.
onload
=
(
)
=>
resolve
(
img
)
;
img
.
onerror
=
reject
;
img
.
crossOrigin
=
"anonymous"
;
img
.
src
=
src
;
}
)
Insert cell
Insert cell
afterOnload
(
src
)
.
then
(
img
=>
img
.
complete
)
Insert cell
Insert cell
afterOnload
(
src
)
.
then
(
crop
)
Insert cell
Insert cell
afterOnload
(
src
)
.
then
(
img
=>
crop
(
img
)
.
toDataURL
(
)
)
Insert cell
html
`<img src="${
await
afterOnload
(
src
)
.
then
(
img
=>
crop
(
img
)
.
toDataURL
(
)
)
}" style="max-width: 300px" />`
Insert cell
Insert cell
afterDecode
=
src
=>
{
const
img
=
new
Image
(
)
;
img
.
crossOrigin
=
"anonymous"
;
img
.
src
=
src
;
return
img
.
decode
(
)
.
then
(
(
)
=>
img
)
;
}
Insert cell
Insert cell
afterDecode
(
src
)
.
then
(
img
=>
img
.
complete
)
Insert cell
afterDecode
(
src
)
.
then
(
crop
)
Insert cell
afterDecode
(
src
)
.
then
(
img
=>
crop
(
img
)
.
toDataURL
(
)
)
Insert cell
html
`<img src="${
await
afterDecode
(
src
)
.
then
(
img
=>
crop
(
img
)
.
toDataURL
(
)
)
}" style="max-width: 300px" />`
Insert cell
Insert cell
afterDecodeWithoutCORS
=
src
=>
{
const
img
=
new
Image
(
)
;
img
.
src
=
src
;
return
img
.
decode
(
)
.
then
(
(
)
=>
img
)
;
}
Insert cell
Insert cell
afterDecodeWithoutCORS
(
src
)
.
then
(
img
=>
crop
(
img
)
.
toDataURL
(
)
)
Insert cell
html
`<img src="${
await
afterDecodeWithoutCORS
(
src
)
.
then
(
img
=>
crop
(
img
)
.
toDataURL
(
)
)
}" style="max-width: 300px" />`
Insert cell
Insert cell
afterDecodeWithoutCORS
(
src
)
.
then
(
img
=>
img
.
complete
)
Insert cell
afterDecodeWithoutCORS
(
src
)
.
then
(
crop
)
Insert cell
Insert cell
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Listed in...
Network, cache and memoization
Sylvain Lesage
Image
Sylvain Lesage
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
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
afterOnload
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
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
afterDecode
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
afterDecodeWithoutCORS
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
Add comment
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
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
src
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
crop
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML