codec / predictor · 2D / lossless
med
Follow smooth areas without crossing sharp edges.
med is the edge-aware predictor used by JPEG-LS. On smooth areas it behaves like planar. At a strong horizontal or vertical boundary, it clamps the prediction to the nearer neighbour instead of guessing across the edge. This often produces cleaner differences on rasters with abrupt boundaries, although samples must decode in order.
- ctid
- 0x72D705
- header
- uint32 · row width in samples
+ uint32 · plane count, when above one - widths
- 8 · 16 · 32 · 64-bit integers
- decode
- median(W, N, W+N−NW) per sample, in order
Code
geozl.lossless.Med(width, planes=1)