Search code examples
imagewic

Set quantize factor in WIC


I am trying to Replace the encoder module of a application with my own Encoder which use WIC. and the old one seems set the Quantize factor to 90 (i don't know what happen in there, i just have dlls only). Now i have to set quantize factor too but i don't know how. is there any way to set that value like passing some value, or am i need to implement Quantize table and calculate the factor. I sow there is a way to set image quality (which 0 to 1) when initializing the encoder,

PROPBAG2::pstrName = L"ImageQuality";

does that affect to the quantization?

the question looks like silly but google didn't help me. can anyone please help me.


Solution

  • does that affect to the quantization?

    Yes.

    that set the quality level and that decide the quintize table which use to compress.

    normally quality level is considered as a percentage. in WIC it take float value 0-1.

    if you want to set quality level to 90 (it probably says 90%) use 0.9f in WIC.

    and you can set a quantize table too.

    ref: http://fotoforensics.com/tutorial-estq.php