Sinc(Lanczos3) interpolation making patterns like artifacts when scaling.
This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.
This is a read-only list on gimpusers.com so this discussion thread is read-only, too.
Sinc(Lanczos3) interpolation making patterns like artifacts when scaling. | Aliet | 16 Aug 03:09 |
Sinc(Lanczos3) interpolation making patterns like artifacts when scaling. | Ernie Wright | 17 Aug 05:06 |
Sinc(Lanczos3) interpolation making patterns like artifacts when scaling.
Greetings over there.
First let me introduce myself, my name is Aliet Expósito García, I am
Cuban, Computer Science student and Free Software user, now lets get to
the point :)
I use GIMP 2.6.10 in Ubuntu 8.04 and 10.04, and 2.7.1 in Lucid, I use it extensively since I co-own a photographic studio and have to do heavy editing on the pictures, its a fad over here and everyone wants pics with visual effects so ALL pictures must be edited. I noticed on some of the finished pictures some sort of pattern like artifacts and pixels with offending colors whenever there was transparent gray or black over white o clear backgrounds, I also noticed that these were downscaled using Sinc(Lanczos3) interpolation. I've been conducting some tests to compare Cubic and Sinc interpolations on my pictures, I know Sinc is the theoretical optimum but I needed to see in practice if the difference was noticeable enough and if so always use it (Right now I'm biased towards cubic) -- Some details on the Sinc VS Cubic on digital photography resizing would be much appreciated.[1] I already studied the source code, but I'm far from understanding it completely although that's where I caught the curiosity bug regarding the cubic and lanczos functions...
To replicate the issue I'm talking about[1] lets create a new image in
GIMP:
Width: 3000 px
Height: 2000 px
Color space: RGB color (Grayscale gives the same result)
Fill with: White
Once the image is created, go to Image->Scale Image... change the image
size to 99% (2970x1980 pixels), select Sinc(Lanczos3) as Interpolation
method and scale the image. (upscaling shows the same behaviour)
After the scaling is done create a new layer on top and fill it with
Black set its transparency to 90% and zoom to 800%, you will see the
patterns.
Scaling to 10%, 20%, 25%, 40%, 50% or 80% of the original size the
patterns are not observed, any other size is affected (Yes I tried ALL
percent sizes, but only downscaling, upscaling is different)
This also occurs if the layer is filled with black, but it's harder to
see if it is the only layer, so try adding an alpha channel and scale
again.
The alpha channel is affected if it is present on the layer, the pixels affected are 1% more transparent than the others. The pixels affected by transparency may or may not be the same affected by color. Black and Gray(808080) colors are affected only by transparency if the alpha channel is present, otherwise the color is affected.
In any other case the affected color is 1 unit smaller per channel, for
example with White 'ffffff' the affected pixel color is 'fefefe', Gray
'808080' turns to '7f7f7f'
Black instead turns to '010101' (I'm having a hard time replicating this
on a layer without alpha channel)
With various layers it affects all of them, in some cases not but it's very hard to try finding some sense to it since if somehow the patterns are not created in some layers, trying again may affect others, the same or all of them.
It affects all colors, but it is easily seen in neutral colors. Use the Color Picker using the info window and sweep the canvas, you will run into the affected pixels...
I don't know if this has been reported[1] already, if so can someone
please give an explanation about why it happens, it would be much
appreciated.
Right now I can't use the Sinc(Lanczos3) method because the patterns
shows in common pictures, not only the ones I've been testing on.
[1] Accessing Internet around here is very difficult hence the reason I am using the mailing list for this instead of other channels.
Regards, Aliet
--
Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas
Infomed: http://www.sld.cu/
Sinc(Lanczos3) interpolation making patterns like artifacts when scaling.
Aliet wrote:
I noticed on some of the finished pictures some sort of pattern like artifacts and pixels with offending colors whenever there was transparent gray or black over white o clear backgrounds, I also noticed that these were downscaled using Sinc(Lanczos3) interpolation. I've been conducting some tests to compare Cubic and Sinc interpolations on my pictures, I know Sinc is the theoretical optimum but I needed to see in practice if the difference was noticeable enough and if so always use it
There is no perfect resizing filter. All filters will cause one of two kinds of problems, either ringing (windowed sinc filters like Lanczos) or blurring (cubic). You choose between them on a case-by-case basis depending on whether you want to preserve detail (Lanczos) or minimize artifacts (cubic).
Sinc is only ideal in an ideal world. In the real world, resizing filters must have finite extent, and RGB levels are typically limited to 8 bits of precision.
- Ernie http://home.comcast.net/~erniew