538
rule (files.catbox.moe)
submitted 2 years ago* (last edited 2 years ago) by spujb@lemmy.cafe to c/196@lemmy.blahaj.zone

inb4 “it’s actually 14 kb 🤓” it’s the joy that is 1kb in size, here’s an image that’s 1kb:

you are viewing a single comment's thread
view the rest of the comments
[-] MHLoppy@fedia.io 14 points 2 years ago

It's quite challenging to keep the text legible within a 1KB limit. Here I manually removed a few details that more-or-less weren't visible post-compression anyway, then cut the color palette a little. You have to use such a low resolution with such high compression that almost everything gets amputated to keep the text kinda-readable (and even AVIF and JPEG XL (which are usually better than WebP) struggled, at least in my editor): https://files.catbox.moe/eyp2w7.webp

If you can live with 2KB, you don't have to amputate nearly as much: https://files.catbox.moe/g5htfo.webp

In both cases I manually reconstructed the top of the star, but that's a bit "extra" lol.


And just for comparison, no text and 10KB at "full" res: https://files.catbox.moe/9bkn21.webp

The same thing but half res (more optimal at this file size): https://files.catbox.moe/cac65u.webp


Valmond's implicit suggestion of not just quantizing as a pre-processing step (which is what I foolishly did), but actually reducing the saved bit depth of the image might give you something that looks much better overall than what any of the WebP versions we've been playing with here do - if you put in more effort!

Here's an example of a not-fully-optimized implementation that gets down to ~2.5KB as a PNG, or ~2KB as a lossless WebP (i.e., the two images are identical in quality):

With some judicious manual optimization (which I haven't done here), it's plausible you could get this down to 1KB with better overall fidelity than the lossy WebP versions we've been playing with. Not 100% sure, as optimizing images for file sizes this small is not really my wheelhouse!

My main concern with this approach is that you're bottlenecked by resolution - large areas of plain color have a hard limit on their compression with PNG, but lossy compression can go wild with stuff like that.

[-] Nexy@lemmy.sdf.org 6 points 2 years ago
[-] MHLoppy@fedia.io 15 points 2 years ago

Spending too long editing 1KB images is the true meaning of Christmas

[-] MHLoppy@fedia.io 2 points 2 years ago

Responding to Valmond's comment got me thinking about doing some more pre-processing to assist the compression, so here are three more 1KB versions which I think are slightly improved:

[-] spujb@lemmy.cafe 4 points 2 years ago

i truly love how beautiful this community is sometimes <3

this post was submitted on 26 Dec 2024
538 points (97.9% liked)

196

19649 readers
173 users here now

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

Posting rules:

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn't adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196's:

founded 3 years ago
MODERATORS