Skip to content

Documentation on Interpolations for imshow and Image antialiasing #20494

Closed

Description

@JamesMLdoesML

Problem

I found interpolations for imshow and image antialiasing to be unclear because for natural images it is fair to use hanning interpolations due to the frequency spectrum for natural images but for something like a matrix of random Bernoulli this can lead to aliasing effects and other interpolations schemes such as nearest would be more appropriate. In general, this also gives a good example for why we should use matshow instead for imshow to visualise matrices.

Aliasing effects for hanning interpolations
Screenshot 2021-06-23 at 9 05 22 PM

No aliasing effects for nearest interpolations
Screenshot 2021-06-23 at 9 05 36 PM

Links:

Suggested Improvement

Include an example such as the one above of when nearest interpolations or matshow would be more appropriate then imshow with hanning.

Code to reproduce the aliasing effects:
https://colab.research.google.com/drive/1rnIc1mRPLz9nCsmg6Kt4G5erR3_A6dGv?usp=sharing

Activity

  1. jklymak commented on Jun 23, 2021

    @jklymak
    Member

    Please include code in issues, its hard to tell what X is.

    If the anti-aliasing is kicking in, you do not have enough resolution to see any details.

    There is a documentation draft at #18749 explaining the difference between data interpolation and optical anti-aliasing.

    There is a PR at #18782 to add optical anti-aliasing. There is a pretty firm plan to make that available for 3.5.

  2. JamesMLdoesML commented on Jun 23, 2021

    @JamesMLdoesML
    Author

    Hi @jklymak, X is a random matrix with Bernoulli distributions where p=0.5

    Screenshot 2021-06-24 at 12 36 23 AM

  3. jklymak commented on Jun 23, 2021

    @jklymak
    Member

    As pointed out this would be closed by #18749 and #18782

    (Code can be included in GitHub pages directly. Please do not post screenshots.) I'll close here as we are already aware of this concern and tracking it.

  4. linked a pull request that will close this issueENH: allow image to interpolate post RGBA #18782on Jun 23, 2021
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