Domanda

I need to save video frames individually and compress them losslessly. I'm looking for the best method and format in c# - by best I mean the best balance of simplicity of implementation, good compression and reasonable processing requirements.

I know PNG is lossless, but its compression isn't great for photo style images.

I understand that there is a lossless Jpeg format, but is this implemented in C#?

Are there other options I am unaware of?

È stato utile?

Soluzione

Here are some compression ratio's for different kinds of lossless encoding (source, higher is better):

        JPEG 2000R  JPEG-LS L-JPEG  PNG 
bike    1.77        1.84    1.61    1.66
cafe    1.49        1.57    1.36    1.44
cmpnd1  3.77        6.44    3.23    6.02
chart   2.60        2.82    2.00    2.41
aerial2 1.47        1.51    1.43    1.48
target  3.76        3.66    2.59    8.70
us      2.63        3.04    2.41    2.94
average 2.50        2.98    2.09    3.52

As you can see, lossless JPEG does not compress significantly better than PNG, and as PNG is supported much better I would recommend you to just use PNG.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top