Open devernay opened 4 years ago
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): Output with DF2K (issue visible mainly on the 1x1 checkerboard which gets a dark blue taint): output with DF2K_JPEG (almost everything gets yellowed):
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: DF2K_JPEG DF2K did better job with colors but much worse with other artifacts
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):