PNG-spec icon indicating copy to clipboard operation
PNG-spec copied to clipboard

AverageLaneFilter

Open svgeesus opened this issue 4 years ago • 1 comments

Raised by: Alexander Vladimirovich Shportko (chportko) Originally raised: 6 Dec 2005

Dear Thomas Boutell, Mark Adler and employees of PNG Development Group!

I am sending on at your consideration a filter created by myself with the purpose of including the latter into standard PNG:

Function AverageLaneFilter (Left, Upper, UpperLeft, UpperRight)
 begin
  return Left+(UpperRight+2*Upper-3*UpperLeft)/4
 end

Here Left is the value of similar components of the previous point, UpperLeft, Upper, UpperRights are the value of similar components according to the left, central and right points in the previous line correlated with the filtered.

More detailed √ in the file of FiltrPng.doc

svgeesus avatar Jan 19 '21 15:01 svgeesus

I assume it would be Filt(x) = Orig(x) - AverageLaneFilter(a, b, c, d), to match the existing filter types.

The linked doc also describes a LaneFilter (separate from the AverageLaneFilter) which is Left+Upper-UpperLeft. And the linked doc shows the resulting compressed sizes of some test images compressed using various filters (including these new ones). These new filters do sometimes produce the best results. Although, in these test images LaneFilter seems to never be the best option.

We should certainly discuss this.

I would like to get an intuitive grasp on when this filter is better and why. The Paeth filter does a good job of finding a near neighbor byte that is close to the current byte. Perhaps the AverageLaneFilter does a better job on gradients?

ProgramMax avatar Sep 17 '21 06:09 ProgramMax