-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed several accuracy bugs with image resampling #30184
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ayshih
wants to merge
6
commits into
matplotlib:main
Choose a base branch
from
ayshih:more_resample_bugs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fdc6a69
Fix bugs in the calculation of the weight array
ayshih e2cfd66
Fix bug with using the distortion table for nonaffine transformations
ayshih 02ca4dc
Update values in a test
ayshih 8553d0b
Fixed logic for image deletion
ayshih 9846d22
Update baseline images
ayshih 4878616
Loosen tolerances for text-only image differences
ayshih File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ namespace agg | |
} | ||
} | ||
|
||
#ifndef MPL_FIX_IMAGE_FILTER_LUT_BUGS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following code block is removed because it not only has the same bugs as the code in |
||
unsigned pivot = m_diameter << (image_subpixel_shift - 1); | ||
|
||
for(i = 0; i < pivot; i++) | ||
|
@@ -96,6 +97,7 @@ namespace agg | |
} | ||
unsigned end = (diameter() << image_subpixel_shift) - 1; | ||
m_weight_array[0] = m_weight_array[end]; | ||
#endif | ||
} | ||
|
||
|
||
|
Binary file modified
BIN
-21 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_axes/use_colorizer_keyword.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-2.36 KB
(100%)
lib/matplotlib/tests/baseline_images/test_colors/light_source_shading_topo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-52 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_colors/test_norm_abc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+60 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_image/downsampling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+17.6 KB
(150%)
lib/matplotlib/tests/baseline_images/test_image/image_composite_alpha.pdf
Binary file not shown.
Binary file modified
BIN
+1.72 KB
(100%)
lib/matplotlib/tests/baseline_images/test_image/image_composite_alpha.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 59 additions & 48 deletions
107
lib/matplotlib/tests/baseline_images/test_image/image_composite_alpha.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+734 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_image/imshow_masked_interpolation.pdf
Binary file not shown.
Binary file modified
BIN
+85 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_image/imshow_masked_interpolation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 56 additions & 56 deletions
112
lib/matplotlib/tests/baseline_images/test_image/imshow_masked_interpolation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-93 Bytes
(99%)
lib/matplotlib/tests/baseline_images/test_image/interp_alpha.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+274 Bytes
(110%)
lib/matplotlib/tests/baseline_images/test_image/log_scale_image.pdf
Binary file not shown.
Binary file modified
BIN
-3 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_image/log_scale_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+4.02 KB
(100%)
lib/matplotlib/tests/baseline_images/test_image/rgba_antialias.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+5 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_image/upsampling.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-14 Bytes
(100%)
...lib/tests/baseline_images/test_multivariate_colormaps/bivariate_cmap_shapes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-289 Bytes
(96%)
lib/matplotlib/tests/baseline_images/test_patheffects/patheffect1.pdf
Binary file not shown.
Binary file modified
BIN
+25 Bytes
(100%)
lib/matplotlib/tests/baseline_images/test_patheffects/patheffect1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is one of the bugs.
0
andend
are different distances frompivot
, so the corresponding weights typically should not be the same.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the new version under a macro guard, as was done in #28122, so that we keep a track of what's the original Agg and what we changed on top of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, done
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that I can't add a preprocessor definition in
_image_resample.h
a la #28122. There is buggy code inagg_image_filters.cpp
that needs to be skipped, but since it is a CPP file rather than a H file, it gets compiled separately with no awareness of_image_resample.h
. I have put the preprocessor definition (MPL_FIX_IMAGE_FILTER_LUT_BUGS
) here at the top ofagg_image_filters.h
, which is lower level than would be nice, but at least still makes it clear what is custom code.