After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 109817 - Aliasing occurs when using transform tools that scale the image down.
Aliasing occurs when using transform tools that scale the image down.
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other other
: Normal normal
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2003-04-02 21:21 UTC by Øyvind Kolås
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch adding supersampling to app/core/gimpdrawable-transform.c (39.92 KB, patch)
2003-04-02 21:23 UTC, Øyvind Kolås
none Details | Review
app/base/pixel-cache.c (2.06 KB, text/plain)
2003-04-02 21:24 UTC, Øyvind Kolås
  Details
app/base/pixel-cache.c (above is really app/base/pixel-cache.h) (2.33 KB, text/plain)
2003-04-02 21:26 UTC, Øyvind Kolås
  Details
new patch, with pixel-cache integrated into tile-manager.c (43.81 KB, patch)
2003-04-03 13:50 UTC, Øyvind Kolås
none Details | Review

Description Øyvind Kolås 2003-04-02 21:21:17 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.
Comment 1 Øyvind Kolås 2003-04-02 21:23:43 UTC
Created attachment 15406 [details] [review]
patch adding supersampling to app/core/gimpdrawable-transform.c
Comment 2 Øyvind Kolås 2003-04-02 21:24:45 UTC
Created attachment 15407 [details]
app/base/pixel-cache.c
Comment 3 Øyvind Kolås 2003-04-02 21:26:15 UTC
Created attachment 15408 [details]
app/base/pixel-cache.c  (above is really app/base/pixel-cache.h)
Comment 4 Øyvind Kolås 2003-04-03 13:50:35 UTC
Created attachment 15435 [details] [review]
new patch, with pixel-cache integrated into tile-manager.c
Comment 5 Sven Neumann 2003-04-04 11:21:06 UTC
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 &#65533;yvind Kol&#65533;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.
Comment 6 Raphaël Quinet 2004-03-12 22:44:06 UTC
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.
Comment 7 Raphaël Quinet 2004-03-13 11:32:22 UTC
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.