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

color shift in SR output #6

Open
devernay opened this issue Sep 18, 2020 · 2 comments
Open

color shift in SR output #6

devernay opened this issue Sep 18, 2020 · 2 comments

Comments

@devernay
Copy link

devernay commented Sep 18, 2020

There is a noticeable color shift in the output of Real-SR (at least with DF2K-JPEG, I didn't test other models).

That color-shift seems to be texture-dependent, and I'm a bit surprised that SR methods don't avoid this. Other SR methods seem to be flawed by the same issue.

Here's how to post-process the output of Real-SR to remove the color shift: downscale the SR image, compute the difference with the LR image, Gaussian blur, upscale, add to the SR image. All computation is done in linear color space.
This gives this one-line G'MIC script (edited to work also with older versions of gmic):

gmic image.jpg image_4x.jpg -srgb2rgb [1] -resize[1] 25%,25%,[0],[0],2 -sub[0,1] -blur[0] 2 -resize[0] 400%,400%,[0],[0],3 -add -rgb2srgb -output image_4x_nocolorshift.jpg
@devernay
Copy link
Author

devernay commented Sep 30, 2020

Here's a simple image that shows the color shift. You will see that DF2K has issues with a simple 1-piwel checkerboard pattern. DF2K_JPEG has issues with all patterns (maybe that's because it considers them as JPEG artifact, but still they should turn out gray, not yellow).

Input image (from the excellent page on Gamma errors in image resizing http://www.ericbrasseur.org/gamma.html):
gamma_2 2
Output with DF2K (issue visible mainly on the 1x1 checkerboard which gets a dark blue taint):
gamma_2 2
output with DF2K_JPEG (almost everything gets yellowed):
gamma_2 2

@SEt-t
Copy link

SEt-t commented Oct 8, 2020

The issue is very noticeable on some real images too. Proposed G'MIC script helps but still can't correct all the errors.
Example image:
image
DF2K_JPEG
image_scaled
DF2K did better job with colors but much worse with other artifacts
image_scaled_DF2K

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

2 participants