jpeg-python
jpeg-python copied to clipboard
how to adjust compression ratio?and why the decode image after encode will appear some white points, why?
how to adjust compression ratio?and why the decode image after encode will appear some white points, why?
@maliho0803 it is because dct/idct cant get exact same result, and some rgb vlaue become around (-10,0), moreover if using ycbcr color space, it will be more easy to get such value around (-5,0), transfering them to unit8 will make them become (245,255) so you see the white points
how to adjust compression ratio?
@xwk111 I think one way could be adjusting quantization table. Bigger values would enable more rough quantization, which results in smaller data size. You can easiliy test with changing arrays after initialization in load_quantization_table
function in utils.py
.
@timmmGZ Would you plz explain more about white points? I understood that idct after dct can make different result. But I have few questions.
- Why YCbCr color space is more vulnerable to get value around (-5,0) ?
- Could you specify the code where transfer from small negative values ( (-10,0) or (-5,0) ) to uint8 making (245,255)?