Skip to content

Erode / dilate preliminary implementation - #4243

Closed
qpincon wants to merge 2 commits into
lovell:mainfrom
qpincon:main
Closed

qpincon wants to merge 2 commits into
lovell:mainfrom
qpincon:main

Conversation

@qpincon

@qpincon qpincon commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

Adresses #1719.

This is mostly a copy / paste of the previous try of implementation by #1744

The dilate operation works well, however erode does not seem to work but rather just shift the whole black pixels to the bottom right. I really can't tell why. I tried to fill the mask with 0, 128 and 255, but the results are the same.

Original Expected Actual
dot-and-lines erode-1 erode-2

If anyone has an idea as of why it happens, I'll gladly try to fix it!

@lovell

lovell commented Oct 24, 2024

Copy link
Copy Markdown
Owner

Merci beaucoup for the PR Quentin, I'll try to take a look to see if I can work out why the erode operation is not working as expected.

@kleisauke

Copy link
Copy Markdown
Contributor

The dilate operation works well, however erode does not seem to work but rather just shift the whole black pixels to the bottom right. I really can't tell why. I tried to fill the mask with 0, 128 and 255, but the results are the same.

This will be fixed via PR libvips/libvips#4240. Thanks for reporting this!

@faradaytrs

Copy link
Copy Markdown

Is there progress on this? upstream pr is already merged

@lovell

lovell commented Feb 7, 2025

Copy link
Copy Markdown
Owner

@faradaytrs This is dependent on the future libvips v8.16.1. Please subscribe for updates.

@faradaytrs

Copy link
Copy Markdown

@faradaytrs This is dependent on the future libvips v8.16.1. Please subscribe for updates.

seems like it has been released

@lovell

lovell commented Mar 16, 2025

Copy link
Copy Markdown
Owner

The main branch has now been updated to use the latest libvips v8.16.1, which supports the erode feature.

@qpincon If you're still interested and available to help with this PR please can you rebase and test, thank you.

lovell pushed a commit that referenced this pull request Mar 27, 2025
lovell pushed a commit that referenced this pull request Mar 27, 2025
@lovell

lovell commented Mar 27, 2025

Copy link
Copy Markdown
Owner

Rebased and landed via commit 031c808 - merci beaucoup Quentin!

@lovell lovell closed this Mar 27, 2025
@qpincon

qpincon commented Mar 27, 2025

Copy link
Copy Markdown
Contributor Author

Thank you, sorry for not responding earlier!

hanzo-dev pushed a commit to hanzoai/sharp that referenced this pull request Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants