this post was submitted on 26 Dec 2024
496 points (97.7% liked)

196

16749 readers
2776 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 2 years ago
MODERATORS
496
rule (files.catbox.moe)
submitted 1 day ago* (last edited 1 day 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
[–] spujb@lemmy.cafe 19 points 1 day ago (3 children)
[–] MHLoppy@fedia.io 15 points 21 hours ago (3 children)

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.

[–] isolatedscotch@discuss.tchncs.de 6 points 9 hours ago (1 children)

A competitor approaches!

new image, 988 bytes, with text, 125x180 pixels (more quality then your 92x128 1kb)

https://files.catbox.moe/eqbk4e.webp

[–] MHLoppy@fedia.io 4 points 8 hours ago

This is indeed way better!

[–] Nexy@lemmy.sdf.org 6 points 20 hours ago (1 children)
[–] MHLoppy@fedia.io 15 points 20 hours ago

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

[–] MHLoppy@fedia.io 2 points 17 hours ago (1 children)

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 14 hours ago

i truly love how beautiful this community is sometimes <3

[–] MonkderVierte@lemmy.ml 24 points 1 day ago (2 children)
[–] lugal@sopuli.xyz 9 points 1 day ago

True. Reading sucks. This isn't school.

would need a high-quality version of the one with text to start with