Skip to content

Commit

Permalink
Revoked AVIF lossless recommendation.
Browse files Browse the repository at this point in the history
  • Loading branch information
PoneyClairDeLune committed Jul 18, 2024
1 parent f028e3e commit 953bdbd
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/ltgc/encode.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Things to take notice of:

* mozJPEG-fronted JPEG, while offering a good choice for backwards-compatibility, shouldn't be used unless necessary when size is a consideration.
* AVIF offers an advantage on size, when progressive support, boundary artifacts and codec performance (slower than all others multiple times) aren't in consideration.
* AVIF is observed to have fewer observable artifacts for images with a simpler shading.
* The reference AVIF settings provide a balancing point between JXL -d 1 and JXL -d 2.

<div><table>
<thead><tr>
Expand All @@ -87,16 +89,16 @@ Things to take notice of:
<tbody><tr>
<td rowspan=4>JPEG XL</td>
<td>Delivery (quality)</td>
<td><code>cjxl -d 2 -e 7 -p</code></td>
<td><code>cjxl -j 0 -d 2 -e 7 -p --progressive_dc 1</code></td>
</tr><tr>
<td>Archival (quality)</td>
<td><code>cjxl -d 1 -e 7 -p</code></td>
<td><code>cjxl -j 0 -d 1 -e 7 -p --progressive_dc 1</code></td>
</tr><tr>
<td>Delivery (speed)</td>
<td><code>cjxl -d 2 -e 4 -p</code></td>
<td><code>cjxl -j 0 -d 2 -e 4 -p --progressive_dc 1</code></td>
</tr><tr>
<td>Archival (speed)</td>
<td><code>cjxl -d 1 -e 4 -p</code></td>
<td><code>cjxl -j 0 -d 1 -e 4 -p --progressive_dc 1</code></td>
</tr><tr>
<td rowspan=3>WebP</td>
<td>Delivery (perception)</td>
Expand All @@ -119,10 +121,15 @@ The full feature set comparison chart is [available on Cloudinary](https://res.c
![Battle of the image codecs!](https://res.cloudinary.com/cloudinary-marketing/image/upload/w_700,c_fill,f_auto,q_auto,dpr_2.0/Web_Assets/blog/Battle-of-the-Codecs_fnl.png)

### Lossless still
AVIF is the current best solution for lossless image encoding, with JPEG XL tailing behind. If size is the bigger factor, choose AVIF lossless. If compatibility is a concern, choose WebP lossless. JPEG XL in its current state doesn't offer much advantage against AVIF.
JPEG XL lossless and WebP lossless are mostly on par, either could be the better solution at times. For compatibility reasons, WebP lossless should always be offered, while JPEG XL lossless could be offered only when the resulting file is smaller than that of WebP lossless. AVIF lossless is currently consistently worse than either JPEG XL or WebP, as such it's not recommended at all.

Do *not* enable progressive encoding for JPEG XL lossless, or the resulting file will be several times bigger than PNG files.

| Codec | Parameters |
| ----- | ---------- |
| JPEG XL | `cjxl -j 0 -d 0 -e 7` |
| WebP | `cwebp -m 6 -lossless` |

### Lossy animated
Lossy animated WebP is the current baseline for animated image sequences, while lossy animated AVIF offers the best quality against others by a wide margin. Lossy animated JPEG XL doesn't offer a significant advantage against WebP, and is currently beaten by AVIF.

Expand Down

0 comments on commit 953bdbd

Please sign in to comment.