Skip to content

implement means to specify smoothing with PImage.resize() #204

Closed as not planned

Description

@processing-bugs

Original author: b...@processing.org (June 07, 2010 01:13:31)

This bug automatically added from:
http://dev.processing.org/bugs/show_bug.cgi?id=1195

Comment from -RoB-, 2009-03-10 16:22

As part of the cleaning up of the API for PImage in Revision 4720, the internal blit function
was hard-coded to use bilinear filtering with the following at line 1428:

boolean smooth = true; // may as well go with the smoothing these days

I would like to question the logic behind this change. While I understand the thinking behind
this comment, there are some occasions when using nearest neighbour to blit is desired, e.g.,
to achieve pixelation when zooming into an image.

Can the old behavior, using smooth() and noSmooth() to control the use of bilinear filtering,
be reinstated?


NOTE: This change to the blit function has made the documentation for copy() misleading, as
the image in the documentation clearly shows pixelation.

PImage img = loadImage("eames.jpg");
image(img, 0, 0);
copy(15, 25, 10, 10, 35, 25, 50, 50);

The example code is inaccurate in other ways (stroke color and rect position) but these are
perhaps less problematic than the representation of the effect of copying a small area to a
larger one.

Original issue: http://code.google.com/p/processing/issues/detail?id=165

Activity

  1. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From b...@processing.org on June 07, 2010 01:13:31
    Comment from fry, 2010-06-05 03:05

    the logic is that 1) cpu cycles (the reason for the pixelation) is less of
    an issue, 2) almost nobody wants pixelated images, and 3) it's a mess to
    make smooth/noSmooth and the rest of the functions that deal with images
    handle this kind of situation consistently across all of the renderers,
    which comes back to #2. my free time is limited, and i have to choose my
    battles.

    i'll leave it as a feature request if someone wants to take care of making
    this work consistently across the rest of the API.

  2. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From michudr...@gmail.com on December 02, 2010 12:27:29
    for example i want a pixelated image ;)

    i also vote for the old behavior (smooth() or noSmooth()).

    and the processing ide still colors image.noSmooth() and image.smooth() as valid commands.

  3. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From dev...@gmail.com on December 18, 2012 00:47:40
    Indeed, fat pixels are nice for sprites and pixel art.

  4. processing-bugs commented on Feb 10, 2013

    @processing-bugs
    Author

    From f...@processing.org on December 25, 2012 12:20:09
    Please use the forum to discuss coding questions. Those two comments have little/nothing to do with this bug report.

  5. changed the title [-]implement unified means to specify smoothing level for image scaling[/-] [+]implement means to specify smoothing with PImage.resize()[/+] on Apr 27, 2015
  6. removed
    high
    on Apr 27, 2015
  7. github-actions commented on Jul 15, 2026

    @github-actions

    This issue has been automatically closed and locked.

    Processing 3.x is no longer actively developed. Since January 2020, development moved to the Processing 4 repository.

    If this issue is still relevant to Processing 4, we'd love to hear from you. Please open a new issue at:
    https://github.com/processing/processing4/issues/new/choose

    Thank you for helping improve Processing.

  8. locked as resolved and limited conversation to collaborators on Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions