在视频上添加文本,文本颜色应随背景颜色动态变化
我正在与 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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要么为文本使用半透明颜色,要么为其添加半透明背景。
这并不完全是您所要求的,但它是可行的,并且是“下一个最好的事情”。
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'.