What's the smallest file size for a 1 pixel image?


An icon representing a broken image.

There are lots of new image compression formats out there. They excel at taking large, complex pictures and algorithmically reducing them to smaller file sizes. All of the comparisons I've seen show how good they are at squashing down big files. I wanted to go the other way. How good are modern codecs at dealing with tiny files? Using GIMP, I created an image which was a single white pixel, and saved it as a PNG. I then used Squoosh to convert it to a variety of modern formats using…

Continue reading →

Selectively Compressed Images - A Hybrid Format


Screenshot of a camera app on a phone. The middle is a photo, the sides show the user interface.

I have a screenshot of my phone's screen. It shows an app's user interface and a photo in the middle. Something like this: If I set the compression to be lossy - the photo looks good but the UI looks bad. If I set the compression to be lossless - the UI looks good but the filesize is huge. Is there a way to selectively compress different parts of an image? I know WebP and AVIF are pretty magical but, as I understand it, the whole image is compressed with the same algorithm and the same…

Continue reading →

Raster. Vector. Generative.


Ai generated image using the prompt "A photo of a painter painting a picture of a the Mona Lisa. The painter's head has been replaced with a laptop screen showing binary code."

When I was a kid, I "invented" a brilliant new compression format. Rather than sending a digital image of, say, the Mona Lisa a user could just send the ASCII characters "Mona Lisa". The receiving computer could look up the full image in its memory-banks and reproduce the work of art on screen. Genius! Of course, it relies on the receiver have a copy of every single image in existence, but that's just details... It strikes me that AI might now get us part way to that being a reality. …

Continue reading →

You can't screenshot or right click this image


A badly drawn cartoon of a monkey in a t-shirt.

People contact me with all sorts of weird opportunities. Some are fun. Some are not. I've lost count of the number of NFT grifters who've asked me to "revolutionise" the art space. I'm generally not a fan. But I had one chat with someone who wanted to do something intriguing. They were worried about people right-clicking or screenshotting their precious images and had a plan to stop that. I tried to explain to them that DRM always fails; you can't make data which can't be copied. I…

Continue reading →

Other pixel-level meta data you could put in an image format


Two children sat on a ledge. One has a tightly bound yellow border around their outline. The other has a similar green border. The wall they're sitting on has a red border which follows its shape.

Image files are a grid of pixels - each pixel contains colour information. But they don't just have to contain colour information. Here are some thoughts on other things that a future image format might contain. What exists already? A typical bitmap image looks like this under the hood: 0 1 2 3 0 Black Red Red Blue 1 Red White Blue Yellow 2 Orange Purple Green Brown ... That is a grid of pixels, each with a colour value. Modern image formats can also contain…

Continue reading →

Quick Image Montages


85 Book Covers.

(Mostly notes to myself.) If you have a lot of images in a directory, and want to quickly make an image montage, here's how to do it on Linux using ImageMagick. First up, this command finds all JPG file, then resizes them so they fit in a maximum box of 256x256, then sets the quality to 75%, then saves them as JPGs: find ./ -type f -iname "*.jpg" -exec mogrify -verbose -format jpg -layers Dispose -resize 256\>x256\> -quality 75% {} + This will overwrite your existing files so make sure you…

Continue reading →

Turning an eInk screen into a monochrome art gallery


Previously on Terence Eden's Blog: I turned an old eReader into an Information Screen. This time, I'm taking a different Nook, and turning it into a magic gallery. Here's what it looks like in action: Terence Eden is on Mastodon@edentUpcycled an old eReader into an art frame.Displays a new black & white piece of art from Flickr every few minutes.Full write-up this weekend, but pretty straightforward to do. pic.x.com/ttvrbhz3ee❤️ 137💬 14🔁 021:20 - Wed 22 September 2021 Video With the front l…

Continue reading →

Coping with HEIC in the browser


The best camera is the one that's with you./

Apple's HEIC format is... annoying. At the moment, Apple's products are the only mainstream cameras which use it. Forums are littered with people trying to upload HEIC files to web services and failing. So, here are four quick tips for dealing with this formal. Display in browser Absolutely no browser supports HEIC. Not even Apple's own browser supports it. Why? Terence Eden is on Mastodon@edentOK, but *why* is the iPhone's default photo format HEIC if the iPhone's default browser can't…

Continue reading →

Three small tips for shrinking SVG images


Rows of icons - each one has the size printed next to it.

I work on the SuperTinyIcons project. Our aim is to make pixel perfect SVG icons in under 1KB. Because SVG can be quite verbose, every single redundant byte we can eliminate is a byte we can use in drawing. Here are three quick tips for shaving a few bytes off an SVG. Decimal Magic SVG co-ordinates can have decimal precision, like: 123.456. But what about co-ordinates which are less than one? 0.123 can be rewritten as .123 - we can drop the 0! These two sed commands will turn 0. to . and…

Continue reading →

How to fake Progressive WebP Images


Extremely fuzzy photo.

WebP is the hip new image format on the scene. It offers unrivalled image compression at superior visual quality. But, in my opinion, it is deficient compared to JPG in one significant aspect. It doesn't have a progressive mode. Progressive mode is useful because it can quickly load a low resolution preview of an image, and then gradually improve its quality. WebP, by contrast, just loads up the full image line by line. That's can be annoying on a slow connection. What if we could change…

Continue reading →

Should panoramic images be part of the HTML5 specification?


360 view of the inside of the concert hall.

Noodling thoughts. The humble <img> element is one of the oldest parts of HTML. It allows you to put a static image in a document. Later revisions allowed for animated images - like GIFs. And the <map> element made parts of the image clickable. But what about interactive images? Like panoramas and photospeheres? Here's a 360° image. You can drag it to see all around. That uses the fantastic Pannellum JavaScript Library. At the moment, there's no native way to represent that in HTML. If …

Continue reading →