Hi Guys this is my project explaination how does the Pixelate work on steps:
Step 1: Shrink (this is where the magic happens)
jsconst small = document.createElement(‘canvas’);
small.width = 64;
small.height = 64;
small.getContext(‘2d’).drawImage(srcImg, 0, 0, 64, 64);
Imagine your photo is 1920×1080 pixels. You squish it down into a 64×64 canvas.
To fit a million pixrls into 64×64, the browser has to merge groups of pixels into one. It looks at a chunk of the original image (say, a 30×17 block) and blends them all into a single average color.
Result: you now have a real, tiny image — 64×64 actual pixels, each one a blended color from a chunk of the original.
Step 2: Blow it bacl up (with no smoothing)
jscanvas.style.width = ‘384px’; // 64 × 6
canvas.style.height = ‘384px’;
cssimage-rendering: pixelated;
Now you take that tiny 64×64 image and stretch it to be way bigger on screen.
Normally, browsers smooth out stretched images (blurry). The pixelated setting turns smoothing off. So each of the 64×64 pixels just gets copied into a big solid square — no blending, no blur.
Result: big, crisp, blocky squares = the pixel art look.
Putting It Together
big detailed photo
↓ (squish down — merges pixels, loses detail)
tiny 64×64 image
↓ (stretch up — no smoothing, just copy each pixel bigger)
big blocky pixel art
The squish is what creates the pixel art (real data, real file).
The stretch is just so you can see it clearly on screen — it adds zero new information.
Why the Download File is Small
When you hit download, it saves the tiny 64×64 image (from Step 1) — not the big stretched version. The “blow it back up” part was only for your screen.
And this done in client side, we dont collect your image or saving ur image
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.