←back to thread

A new PNG spec

(www.programmax.net)
618 points bluedel | 1 comments | | HN request time: 0s | source
Show context
razorfen ◴[] No.44378903[source]
Can anyone explain how they maintain backwards compatibility on formats like this when adding features? I assume there are byte ranges managed in the format, but with things like compression, wouldn’t compressed images be unrenderable on clients that don’t support it? I suppose it would behoove servers to serve based on what the client would support.
replies(3): >>44378988 #>>44379010 #>>44379105 #
joshmarinacci ◴[] No.44379010[source]
The PNG format has chunks with types. So you can add an additional chunk with a new type and existing decoders will ignore it.

There is also some leeway for how encoding is done as long as you end up with a valid stream of bits at the end (called the bit stream format), so encoders can improve over time. This is common in video formats. I don’t know if a lossless image format would benefit much from that.

replies(1): >>44379130 #
1. gmueckl ◴[] No.44379130[source]
PNG is a bit unusual in that it allows a couple of alternate compressed encodings for the data that are all lossless. It is up to the encoder to choose between them (scanline by scanline, IIRC). So.this encoding algorithm leeway is implicit in a way.