ilyakurdyukov / jpeg-quantsmooth

JPEG artifacts removal based on quantization coefficients.
GNU Lesser General Public License v2.1
254 stars 21 forks source link

Strange color issue happen on -q 5~6(--quality) #24

Open Lee-lithium opened 2 years ago

Lee-lithium commented 2 years ago

Hello Ilya Kurdyukov, Sorry to bother you.

I get some strange color issue on non-photo drawing content,
those issue will happen on -q 5~6(--quality).

In this non-photo picture case, green book middle area have some tiny red pixel,
-q 3~4 haven't happen this issue.

original-cut-png (jpeg q90 420) original

qs-q6-png q6

JPEG Quant Smooth : Copyright (C) 2020 Ilya Kurdyukov : 2020-05-17
Build date: Jan 11 2021
https://github.com/ilyakurdyukov/jpeg-quantsmooth/releases/tag/1.20210110

jpegqs64 -q 6 -o -t 12 test.jpg test-qs.jpg
sample.zip

ilyakurdyukov commented 2 years ago

I'm not really in the mood to solve this now because of the current world situation that happened because of my country.

This is when the UV upscaler makes the wrong decisions. Need a way to limit this. As I see it, mostly the upscaler works correctly, but in some places it creates artifacts.

Try replacing the text "16.0f" (use "search and replace") in quantsmooth.h with a smaller value (8.0f, 4.0f, 2.0f). Maybe I chose too high value for the limit.

Lee-lithium commented 2 years ago

I understand, Thank you for your reply.
I'm sorry about this world situation, hope everything’s gonna be okay.

ilyakurdyukov commented 2 years ago

If you find a better value for this constant - feel free to tell me.

ilyakurdyukov commented 2 years ago

This limit doesn't solve the problem, need a different solution.

zvezdochiot commented 2 years ago

Hi @ilyakurdyukov .

Maybe track the value of the coefficients on a given image via gdb?

Or use #if DEBUG for dump?

ilyakurdyukov commented 2 years ago

It seems to be the sum of small errors from different methods. In the original, the chroma has a red dot here, which gets brighter after reducing the artifacts, and then colors part of the line after the chroma upscale and gets even brighter. Unfortunate artifact from recovering the lost precision.

I saw this once in my test data as a miscolored dot.