pixelate
Version:
Pixelate an image with canvas
42 lines (35 loc) • 606 B
CSS
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: "Courier New", Courier, monospace;
padding: 10px;
}
h1 {
display: block;
text-align: center;
padding: 20px;
}
.container {
max-width: 400px;
margin: 0 auto;
}
.image {
width: 100%;
}
.pixelation {
padding: 10px 0;
}
output {
display: inline-block;
}
canvas {
image-rendering: optimizeSpeed;
image-rendering: -moz-crisp-edges;
image-rendering: -webkit-optimize-contrast;
image-rendering: -o-crisp-edges;
image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor;
}