Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Clip small linewidths in agg#14560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
timhoffm wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromtimhoffm:clip-agg-linewidth

Conversation

timhoffm
Copy link
Member

PR Summary

Fixes#14498. See there for a full discussion.

Note: I've noticed that the following code uses a mixture ofgc.linewidth (the original value) andlinewidth (the clipped value). Can somebody with more Agg knowledge please check if that is correct?

// Too small linewidths are clipped because they require a lot of
// computation and do not make sense even with antialiasing.
// Compare github #14498.
linewidth = (linewidth < 0.01) ? 0.01 : mpl_round(linewidth);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I guess clipping at 1/256 would make sense because the quantization of the channels is 8bit so linewidths<1/256 (or half that? perhaps...) would be quantized to zero.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What are channels in this context? I only know color channels but don't see how that could be related to linewidth.

Anyways, 0.01 causes some image comparison failures, trying 0.001 to see if that fixes it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I meant color channels.
With antialiasing, linewidths<1 are basically represented by setting the color channels to (linewidthreal_color) (blending with the background), but that's then quantized to 8 bits so linewidths<1/(2256) should result in nothing being drawn.

anntzer
anntzer previously approved these changesJun 17, 2019
@anntzeranntzer dismissed theirstale reviewJune 17, 2019 05:43

... modulo CI

@timhoffm
Copy link
MemberAuthor

timhoffm commentedJun 17, 2019
edited
Loading

Still 44 image comparison failures for a cutoff at 0.001. Needs to be investigated, ... later.
I'm really surprised that the test suite contains code a all that triggers the cutoff. In particular, would that mean we have some performance bottlenecks builtin somewhere?

@anntzer
Copy link
Contributor

Possibly clip small linewidths to zero (i.e. don't draw them at all) instead of 0.001? just a random idea...

@timhoffm
Copy link
MemberAuthor

Try forcing linewidth < 0.001 to 0.

@timhoffm
Copy link
MemberAuthor

timhoffm commentedJul 7, 2019
edited
Loading

Interestingly, forcing linewidth < 0.001 to 0 causes a lot of image comparison failures with dashed lines having slightly modified widths.

@tacaswelltacaswell added this to thev3.3.0 milestoneAug 24, 2019
@QuLogicQuLogic modified the milestones:v3.3.0,v3.4.0May 2, 2020
@jklymakjklymak marked this pull request as draftJuly 23, 2020 16:31
@timhoffm
Copy link
MemberAuthor

Anybody can pick this up if wanted. I don't have the time to debug this for now.

@QuLogicQuLogic modified the milestones:v3.4.0,v3.5.0Jan 21, 2021
@timhoffmtimhoffm modified the milestones:v3.5.0,v3.6.0Jul 11, 2021
@timhoffmtimhoffm modified the milestones:v3.6.0,unassignedApr 30, 2022
@story645story645 modified the milestones:unassigned,needs sortingOct 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Projects
None yet
Milestone
future releases
Development

Successfully merging this pull request may close these issues.

Freeze when setting dashed linewidth to a close-to-zero float
5 participants
@timhoffm@anntzer@tacaswell@QuLogic@story645

[8]ページ先頭

©2009-2025 Movatter.jp