GNOME Bugzilla – Bug 109817
Aliasing occurs when using transform tools that scale the image down.
Last modified: 2004-12-22 21:47:04 UTC
Using the scale and perspective tools on an image will make aliasing since the current implementation is only correct when the transform results in enlargement or no enlargement. Below is three attachments, a new way to access pixels that go in app/base/pixel-cache.[ch] and a patch to app/core/gimpdrawable-transform.c that changes the resampling behavior when scaling a image down. at the moment the #define RECURSION_LEVEL is set to 3 which seems to be a reasonable default, but this should probably be an option in the user interface and in the PDB function that is registered.
Created attachment 15406 [details] [review] patch adding supersampling to app/core/gimpdrawable-transform.c
Created attachment 15407 [details] app/base/pixel-cache.c
Created attachment 15408 [details] app/base/pixel-cache.c (above is really app/base/pixel-cache.h)
Created attachment 15435 [details] [review] new patch, with pixel-cache integrated into tile-manager.c
Applied the patch after tweaking it a little to make the code conform with our coding standards: 2003-04-04 Sven Neumann <sven@gimp.org> Applied a patch from �yvind Kol�s that adds supersampling to the transform operations (bug #109817): * app/base/tile-manager-private.h * app/base/tile-manager.[ch]: cache the last accessed tile and use it to optimize read_pixel_data_1(). * app/core/gimpdrawable-transform-utils.c * app/core/gimpdrawable-transform.c: changed the resampling behavior when scaling down.
This bug must unfortunately be re-opened because the supersampling was causing undesirable blurring in some transformations. So the recursion level has been set to 0 until we can make the recusrion level settable by the user (as suggested in the first patch attached above). See the test results attached to bug #136702 for details.
New option added to the transform tools. See bug #136702 for details. 2004-03-13 Raphaël Quinet <quinet@gamers.org> * app/tools/gimptransformoptions.[ch]: added new "supersample" property to GimpTransformOptions and added corresponding check button in the option dialog for the transform tools. * app/core/gimpdrawable-transform.[ch], * app/core/gimpdrawable.c, * app/tools/gimptransformtool.c: new "gboolean supersample" parameter added to gimp_drawable_transform_tiles_affine() and gimp_drawable_transform_affine(). * tools/pdbgen/pdb/transform_tools.pdb: ditto. For the PDB calls, the supersample parameter is set to FALSE for "rotate" and "shear" and set to TRUE for "perspective", "scale" and "transform_2d". * app/pdb/transform_tools_cmds.c: regenerated. The new "supersample" option lets the user decide if the transformations should use supersampling (RECURSION_LEVEL 3) or not. This fixes both bug #136702 and bug #109817. Hopefully for good, this time.