Add SSIM-based downscaling/transformations
Description of the feature
I've upscaled an image with nearest neighbour by the factor n,
rotated it by 45° and then saved it.
After that I used the SSIM based downscaling program (the C file in the attachment) to downscale the rotated image files by the factor n.
I've also rotated them without up and downscaling and compared the results.
Test images with result and an old C source code are in this zip: rotation_test.zip
The newest code is there: https://gist.github.com/HybridDog/dd95a99d411972f030fb18543280ad60
I don't show the images directly here because web browsers display images inaccurately in my recent experience.
Please have a look at the results and tell me what you think.
You can test it yourself ($ gcc -Wall -Ofast png_percept_down.c -DTILEABLE=0 -o png_ssim_down -lpng -lm
, then $ ./png_ssim_down < in.png > out.png 4
to downscale in.png by the factor 4).
I think this method could be added to gimp for transforms (such as rotation) where the user can specify n, if it's set to 0, no up and downscaling is performed (current behaviour).
Use cases
Higher/different quality of rotation
The same can be done for shear, warp and other transforms.