Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to adjust compression ratio?and why the decode image after encode will appear some white points, why? #4

Open
maliho0803 opened this issue Sep 29, 2019 · 4 comments

Comments

@maliho0803
Copy link

maliho0803 commented Sep 29, 2019

how to adjust compression ratio?and why the decode image after encode will appear some white points, why?
image

image

@maliho0803 maliho0803 changed the title how to adjust compression ratio? how to adjust compression ratio?and why the decode image after encode will appear some white points, why? Sep 29, 2019
@timmmGZ
Copy link

timmmGZ commented Mar 25, 2020

@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

@ZJU-XWK
Copy link

ZJU-XWK commented Jan 14, 2021

how to adjust compression ratio?

@seonjunn
Copy link

seonjunn commented Oct 10, 2021

@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.

@seonjunn
Copy link

@timmmGZ Would you plz explain more about white points? I understood that idct after dct can make different result. But I have few questions.

  1. Why YCbCr color space is more vulnerable to get value around (-5,0) ?
  2. Could you specify the code where transfer from small negative values ( (-10,0) or (-5,0) ) to uint8 making (245,255)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants