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

[Bug]: 无法处理透明图片 #830

Open
fatecyx opened this issue Jan 20, 2025 · 1 comment
Open

[Bug]: 无法处理透明图片 #830

fatecyx opened this issue Jan 20, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@fatecyx
Copy link

fatecyx commented Jan 20, 2025

Issue

如图
Image

原图
Image

Command Line Arguments

Console logs

@fatecyx fatecyx added the bug Something isn't working label Jan 20, 2025
@popcion
Copy link
Contributor

popcion commented Mar 2, 2025

因为透明图片根本没位置涂字,除非主动加个对比度高的背景板。

有个想法是先检测图片是否有透明通道,如果有透明通道,用自带的OCR检测字体颜色然后反转这个颜色,自动添加带反转后颜色的背景板然后再进行涂字,这样对比度高。
可以设置对应参数:参数1:是/否启用对透明图片的处理 参数2:自动/自定义设定背景板颜色。

有人有想法可以帮忙加。

ENG
Since there is no place to render on transparent images unless a background is actively added, I have an idea:

First, detect whether the image has a transparency Alpha channel. If it does, use the OCR to detect the font color and then invert that color. Automatically add a background with the inverted color, and then proceed to render the text.
Can set the corresponding parameters:
Enable/Disable processing for transparent images.
Automatic/Custom setting for the background color on transparent images.
If anyone has the ability and is interested, you can help try modifying the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants