Skip to content
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

fix(filter): pixelate behaves differently under webgl, and should be squares rather than image scale #10081

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

xushengfeng
Copy link
Contributor

Description

In Pixelate.applyTo2d, Pixels are squared, which is consistent with the expected performance
But in webgl, pixels follow the width and height of the image.

In Action

Copy link

codesandbox bot commented Aug 20, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@asturur
Copy link
Member

asturur commented Aug 21, 2024

i remember noticing this and for some reason i thought i fix it, eventually i didn't.

@asturur
Copy link
Member

asturur commented Aug 21, 2024

Can you post a screenshot of a non square image after pixelate filter is applied? thank you

@xushengfeng
Copy link
Contributor Author

xushengfeng commented Aug 21, 2024

https://jsfiddle.net/5vojyagL/5/
eSearch-2024-08-21-23-25-46-867

a 200*100 gradient as an example photo

@asturur
Copy link
Member

asturur commented Aug 21, 2024

This is with your fix or without?

@xushengfeng
Copy link
Contributor Author

the fiddle example is 6.3.0 which isnot fixed

I applied the changes I made in the pull directly in index.min.mjs and it worked fine. I believe this pull change also applies to the source code (because the characters of this change are not affected by compilation)

@asturur
Copy link
Member

asturur commented Aug 21, 2024

This is good to merge, it would be nice to add a visual test for regressions and a changelog.
The changelog you can figure out by looking at the changelog.MD file, for the test i can do it as soon as i have some minute free

@asturur asturur merged commit 9e7e96e into fabricjs:master Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants