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

Inpainting of text with transparent background #302

Closed
xulihang opened this issue Oct 5, 2022 · 1 comment
Closed

Inpainting of text with transparent background #302

xulihang opened this issue Oct 5, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@xulihang
Copy link
Owner

xulihang commented Oct 5, 2022

OpenCV's inpainting cannot handle transparency. So ImageTrans will convert the color space from BGRA to BGR for inpainting. This works well for text with a colored background. But if the text has a transparent background, it does not work.

2 6 1

Possible solution:

If the percent of pixels with a 0 alpha value of a text area is over 25%, then set the part of the image corresponding to the text mask to transparent.

@xulihang xulihang added the enhancement New feature or request label Feb 24, 2023
@xulihang
Copy link
Owner Author

xulihang commented Mar 17, 2024

In v2.9.1, I added a transparent text mode to precisely remove the text.

It will remove text based on the text mask and near pixels' values.

It is recommended to check the process by text areas checkbox.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant