H.264, H.265, VP9, and AV1 all support losless encoding (regardless of color count).
Webp is the more literal replacement for the GIF use case though and also has no color limitations in the lossless animation mode.
Re:The fastest GIF does not exist
by garaetjjte on Sunday February 20, 2022 @01:13PM
(#30407820)
>something not possible with any of the video codecs
Which codecs? You can have eg. lossless H264 just fine.
Re:The fastest GIF does not exist
by LeoPanthera on Sunday February 20, 2022 @01:18PM
(#30407867)
Lossless h264 requires 4:4:4 chroma, which is allowed by the spec but not supported by many consumer playback methods. (QuickTime Player, for example, only supports the yuv420p pixel format.)
It is part of the High 4:4:4 Predictive profile, but you can use it with 4:2:0 subsampling if you want. It's more accurate that the all profiles H.264 defined kinda sucked except for Main, and no one really thought 10bit, 422 or especially 444 were useful and completely ignored those profiles until it was too late to be worth implementing.
Actually, lossless video is also rather marginally useful, especially given the decode cost of the arithmetic coding H.264/HEVC/VP9/AV1 have.
Ironically for your example, lossless, 4:4:4, and 10bit H.264 actually will play back on the new M1 Macs in QuickTime Player, though with a warning about it.
If your animation has <256 colors then it's even lossless, something not possible with any of the video codecs.