File Format #8

Open
opened 2025-01-01 19:26:07 -05:00 by dinhero21 · 7 comments

What file format should be used?
Currently, it is PNG, which might be a good choice for historic integrity.
However, other file formats, such as WebP and JPEG XL provide way better quality/size ratios.

What file format should be used? Currently, it is [PNG](https://en.wikipedia.org/wiki/PNG), which might be a good choice for historic integrity. However, other file formats, such as [WebP](https://en.wikipedia.org/wiki/WebP) and [JPEG XL](https://en.wikipedia.org/wiki/JPEG_XL) provide way better quality/size ratios.
Owner

The one that the screenshot was taken with

The one that the screenshot was taken with

+1 with JPEG XL because IIRC it provides better compression ratios than WebP, but support for JPEG XL and WebP are much less widespread than PNG.

Perhaps the screenshots should be ran through a program like pngcrush to reduce the file sizes instead?

+1 with JPEG XL because IIRC it provides better compression ratios than WebP, but support for JPEG XL and WebP are much less widespread than PNG. Perhaps the screenshots should be ran through a program like pngcrush to reduce the file sizes instead?
Owner

On a serious note, I don't think the file format is that important. Most people will take screenshots with Minecraft's built-in screenshot functionality, which will use PNGs.

I don't particularly want to re-encode all of the images while merging PRs or adding new screenshots, or force others to do so. But I'm not going to deny PRs or issues that add screenshots in different formats, so feel free to utilize different formats for your images if you wish.

On a serious note, I don't think the file format is that important. Most people will take screenshots with Minecraft's built-in screenshot functionality, which will use PNGs. I don't particularly want to re-encode all of the images while merging PRs or adding new screenshots, or force others to do so. But I'm not going to deny PRs or issues that add screenshots in different formats, so feel free to utilize different formats for your images if you wish.
Author

+1 with JPEG XL because IIRC it provides better compression ratios than WebP, but support for JPEG XL and WebP are much less widespread than PNG.

Perhaps the screenshots should be ran through a program like pngcrush to reduce the file sizes instead?

from my personal experience, WebP is supported basically everywhere nowadays, not so much JPEG XL

I'm personally against using tools that make PNG ""better"" since:

  • I'd only use it for historic preservation, as I don't see any benefits over WebP
  • at least for me, they leave noticeable artifacts, while providing a worse quality/size ratio than others
> +1 with JPEG XL because IIRC it provides better compression ratios than WebP, but support for JPEG XL and WebP are much less widespread than PNG. > > Perhaps the screenshots should be ran through a program like pngcrush to reduce the file sizes instead? from my personal experience, WebP is supported basically everywhere nowadays, not so much JPEG XL I'm personally against using tools that make PNG ""better"" since: - I'd only use it for historic preservation, as I don't see any benefits over WebP - at least for me, they leave noticeable artifacts, while providing a worse quality/size ratio than others
Author

(oops, misclick)

(oops, misclick)
Author

On a serious note, I don't think the file format is that important. Most people will take screenshots with Minecraft's built-in screenshot functionality, which will use PNGs.

I don't particularly want to re-encode all of the images while merging PRs or adding new screenshots, or force others to do so. But I'm not going to deny PRs or issues that add screenshots in different formats, so feel free to utilize different formats for your images if you wish.

I suggest transcoding automatically to near-lossless WebP (or JPEG XL if it provides significantly smaller file sizes) IF repo size ever becomes an issue.
(which I doubt it ever will, since code.chipmunk.land has way bigger repos)

> On a serious note, I don't think the file format is that important. Most people will take screenshots with Minecraft's built-in screenshot functionality, which will use PNGs. > > I don't particularly want to re-encode all of the images while merging PRs or adding new screenshots, or force others to do so. But I'm not going to deny PRs or issues that add screenshots in different formats, so feel free to utilize different formats for your images if you wish. I suggest transcoding automatically to near-lossless WebP (or JPEG XL if it provides significantly smaller file sizes) **IF** repo size ever becomes an issue. (which I doubt it ever will, since code.chipmunk.land has way bigger repos)
Owner

Testing out a few different file formats/compression formats on my images...

  • WebP: 112% size reduction
[amy@host memories/2025 new year/amyavi]$ du -sh .
53M     .
[amy@host memories/2025 new year/amyavi]$ mogrify -format webp -define webp:lossless=true *
[amy@host memories/2025 new year/amyavi]$ rm *.png
[amy@host memories/2025 new year/amyavi]$ du -sh .
25M     .
  • pngcrush: 65% size reduction
    It should be noted that converting my images to pngcrush took about 3 minutes after making it use all my 24 CPU threads. (Ryzen 9 7900x)
[amy@host memories/2025 new year/amyavi]$ du -sh .
53M     .
[amy@host memories/2025 new year/amyavi]$ for f in *.png; do echo pngcrush -reduce -brute "$f" ../amyavi_crushed/"$f"; done | parallel -j$(nproc)
[amy@host memories/2025 new year/amyavi]$ mv ../amyavi_crushed/*.png .
[amy@host memories/2025 new year/amyavi]$ rm -r ../amyavi_crushed
[amy@host memories/2025 new year/amyavi]$ du -sh .
32M     .
Testing out a few different file formats/compression formats on my images... - WebP: 112% size reduction ``` [amy@host memories/2025 new year/amyavi]$ du -sh . 53M . [amy@host memories/2025 new year/amyavi]$ mogrify -format webp -define webp:lossless=true * [amy@host memories/2025 new year/amyavi]$ rm *.png [amy@host memories/2025 new year/amyavi]$ du -sh . 25M . ``` - pngcrush: 65% size reduction It should be noted that converting my images to pngcrush took about 3 minutes *after* making it use all my 24 CPU threads. (Ryzen 9 7900x) ``` [amy@host memories/2025 new year/amyavi]$ du -sh . 53M . [amy@host memories/2025 new year/amyavi]$ for f in *.png; do echo pngcrush -reduce -brute "$f" ../amyavi_crushed/"$f"; done | parallel -j$(nproc) [amy@host memories/2025 new year/amyavi]$ mv ../amyavi_crushed/*.png . [amy@host memories/2025 new year/amyavi]$ rm -r ../amyavi_crushed [amy@host memories/2025 new year/amyavi]$ du -sh . 32M . ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: chipmunk.land-kaboomserver/memories#8
No description provided.