this post was submitted on 26 Dec 2024
431 points (97.4% liked)

196

16749 readers
2897 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
431
rule (files.catbox.moe)
submitted 20 hours ago* (last edited 16 hours 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:

top 20 comments
sorted by: hot top controversial new old
[–] isolatedscotch@discuss.tchncs.de 76 points 16 hours ago* (last edited 16 hours ago) (2 children)

since the 1kb example was actually 1.1kb I re-made it while also improving the quality ten-fold

(check it out - it really is 1kb!)

[–] Valmond@lemmy.world 4 points 4 hours ago (1 children)

I bet a hand crafted png can be smaller still, we used png for video games back in the day and there were some heavy tweaking bringing them down to close to nothing (removing all metadata, reducing the number of colors, ...).

Maybe they were bigger than 1kb, gotta dig up some examples...

[–] MHLoppy@fedia.io 1 points 2 hours ago

The maximum color quantization you can do on this image without huge information errors is something like:

  • 1x yellow-brown for stars / streamers / shorts / socks
  • 1x brown for tree base (though it might be better to remove the base to save a color)
  • 1x red for baubles / hat / sweater / shoes
  • 1x green for tree
  • 1x blue for hair (potentially you could merge the tree color if you want to really push it)
  • 1x skin tone for skin
  • 1x pink for mouth
  • 1x black for lines
  • 1x light yellow for background

Which is 9 total colors. This would also require living with aliased text ( c r u n c h y ), since it would be data-expensive to add extra shades of gray. At that point you're no longer making a low-quality copy of the original - you'd basically be making a pixel art version of it since you can't afford any colors for anti-aliasing and gradients.

Here's an example PNG with 9 unique colors and some pretty simple patterns without huge information density: https://files.catbox.moe/bj0acl.png

Even that's 1,847 bytes! (i.e., basically 2KB)

[–] spujb@lemmy.cafe 19 points 14 hours ago (3 children)
[–] MHLoppy@fedia.io 13 points 6 hours ago (2 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

[–] MHLoppy@fedia.io 1 points 2 hours 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:

[–] Nexy@lemmy.sdf.org 5 points 4 hours ago (1 children)
[–] MHLoppy@fedia.io 11 points 4 hours ago

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

[–] MonkderVierte@lemmy.ml 22 points 13 hours ago (2 children)
[–] lugal@sopuli.xyz 7 points 11 hours ago

True. Reading sucks. This isn't school.

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

[–] metaStatic@kbin.earth 27 points 20 hours ago (1 children)
[–] spujb@lemmy.cafe 25 points 19 hours ago (1 children)

idk who makes the inb4 rules but it’s not yall

[–] NakariLexfortaine@lemm.ee 5 points 14 hours ago* (last edited 14 hours ago)

OP can't inb4 because it cuts off pedantic nerds who only get pleasure from correcting someone on the internet, and said pedantic nerds are the same ones who decided there needed to be rules about this sort of thing.**

**translated from old 4chan speak.

[–] quink@lemmy.ml 10 points 16 hours ago* (last edited 16 hours ago)

ε°ε²©δΊ•γ‚ˆγ€γ°, Koiwai Yotsuba is the character, for anyone who doesn't know. Yotsuba&! is an excellent manga, to be enjoyed by everyone.

[–] JudahBenHur@lemm.ee 5 points 17 hours ago (2 children)

im showing the image as 14kb

[–] spujb@lemmy.cafe 5 points 16 hours ago (1 children)

sure enough, fixed the body text, i must have accidentally uploaded one of the images i used when messing around with getting the little one

[–] JudahBenHur@lemm.ee 2 points 16 hours ago

glad to be of service

[–] sleen@lemmy.zip 3 points 16 hours ago

Nooooo this is Lemmy u can't 😭😭😑