Tag: images

Recent Post

Compress an Image File in the Browser with JavaScript

Using the HTML5 Canvas API, you can do image compression on the frontend.

Random Image with JavaScript

You can use JavaScript to display a random image, both on page load and when a user clicks to get ano

Image URL to Blob in JavaScript

Let Fetch's response.blob() method do the hard work!

How to save and retrieve images from localStorage

You can use the FileReader API to create a data URL and pass this through localStorage.

Preview a user image before it is uploaded

How to preview an image and check its dimensions and size before uploading.

Lazy image and iframe loading using pure HTML

Just set the HTML 'loading' attribute to 'lazy' for images and iframes!