在视频上添加文本,文本颜色应随背景颜色动态变化

发布于 2024-12-09 17:35:08 字数 217 浏览 0 评论 0原文

我正在与 Xuggler & 合作。爪哇。 我已经从视频中提取了图像帧我可以在图像帧上添加文本并通过图像帧重新创建视频。

Graphics2D g = (Graphics2D)Image.getGraphics();
g.drawString(data, x, y);

我想要一种根据背景图像像素颜色更改文本颜色的方法,以便文本每次都保持可见。

I am working with Xuggler & Java.
I have extracted image frames from video & I can add text on Image frame and recreate Video by image frames.

Graphics2D g = (Graphics2D)Image.getGraphics();
g.drawString(data, x, y);

I want a way to change color of text according to background image pixel color so that text remain visible every time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月依秋水 2024-12-16 17:35:08

要么为文本使用半透明颜色,要么为其添加半透明背景。

这并不完全是您所要求的,但它是可行的,并且是“下一个最好的事情”。

Either use a semi-transparent color for the text, or put a semi-transparent background to it.

This is not exactly what you asked for, but it is workable, and 'the next best thing'.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文