Hi dear Community,
today i coded a small algorithm for skaling images.
It works like this:
In the following example image i want to scale a 5*s5 pixel image to 3*3.
I have marked one example pixel.
On the left you can see, which source pixels match the destination pixel.
For calculating the value of the destination pixel, i use all pixels from the source image that are covered by the rectangle corresponding to the destination pixel. I give each pixel a weight according to the area of it that is covered.
Sounds complicated, but i can scale down (factor 2) a 2Megapixel-RGB-image in 150ms on my pc (no supercluster ).
When i compare my result with these of Gimp and Photoshop, i don't see a difference in quality, but still a difference.
I am also surprised that Gimp-bilinear is not the same as Photoshop-bilinear. Its the same game with bicubic interpolation.
Here is an example image:
In small everything looks the same, but in the zoomed version (this time of course without interpolation) the differences are well visible.
Does anyone of you know, what they make different? I did not get it out of the gimp-sources (scale-region.c). And I am interested in getting to know why Gimp and Photoshop differ. I thought that "bilinear" and "bicubic" are mathematically well defined.
It would be great if someone could help me out.
Thanks in advance.