Skip to content

Easily Create Retro Pixelated Graphics for WebGL Browser Games

So here’s just a quick one. Since these days pixelated “retro” graphics are hot, there’s a way you can turn your uncool Full HD browser game into a cool retro game. The key is changing how the browser handles upscaling of images. By default linear filtering is used to upscale lower resolution images. With the CSS property “image-rendering” you can control this (source):

image-rendering: -moz-crisp-edges;         /* Firefox */
image-rendering:   -o-crisp-edges;         /* Opera */
image-rendering: -webkit-optimize-contrast;/* Webkit (non-standard naming) */
image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor; /* IE (non-standard property) *

All you need to do is take your (WebGL) canvas, set the resolution down to something retro-y (e.g. 320×240 px),  scale it up to the full window size and apply the aforementioned styles to the canvas element.

2 replies »

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


  • Just realized one different that might be important... one of them is a contenteditable 1 day ago
  • @nextjs At least it's consistent in browsers. So I know the mistake must be somewhere in my styles or DOM... 1 day ago
  • I'm having a weird issue where the SSR version of my @nextjs page looks slightly different than the CSR version, be…… 1 day ago
  • RT @KialoEdu: 2022 was a busy year for us here at Kialo Edu: we spent most of our time making great new features for you! Check out our r… 6 days ago
  • loving @LastOfUsHBO - really cool seeing it come together in such a well made tv series after having played all the games. 1 week ago


%d bloggers like this: