如何替换影片剪辑中的颜色?

发布于 2024-08-20 21:15:42 字数 396 浏览 2 评论 0原文

我正在尝试拍摄一个角色的电影剪辑并改变他们衣服的颜色。字符由向量组成。

到目前为止,我已经半成功地使用了这种方法:

  1. 停止影片剪辑,
  2. 从当前帧获取位图数据,
  3. 使用阈值替换颜色,
  4. 将生成的位图数据存储在数组中,
  5. 添加 onenterframe 函数 - 清除当前帧并添加位图数据。来自数组中处理后的数据

所以 - 这工作得很好。每个帧在开始时仅处理一次,然后写入影片剪辑的速度非常快。

然而!当在位图上执行替换时,会发生大量锯齿以消除锯齿/像素化。这会产生与阈值不匹配的颜色。因此,主要颜色被正确替换,但它被混合颜色的光环包围:(

我相信应该有更好的方法来做到这一点。任何想法或答案将不胜感激 - 谢谢。

I am trying to take a movieclip of a character and change the colour of their clothes. The character is comprised of vectors.

So far I have semi-sucessfully used this method:

  1. stop the movieclip
  2. take the bitmap data from the current frame
  3. use threshold to replace the colour
  4. store the resulting bitmap data in an array
  5. add an onenterframe function - clear the current frame and add the bitmap data from the processed data in the array

So - this works pretty well. Each frame is only processed once at the beginning and then the write to the movieclip is very quick.

However! As the replacement is being performed on a bitmap there is an amount of aliasing that takes place to remove jaggies/pixelation. This produces colours that are not matched using threshold. So the main colour is replaced correctly but it is surrounded by a halo of mixed colours :(

I am sure there should be a better way to do this. Any ideas or answers would be greatly apreciated - Thanks.

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

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

发布评论

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

评论(1

叫嚣ゝ 2024-08-27 21:15:42

会玩Grant Skinner更容易使用ColorMatrix类)得到工作完成了吗?

Would playing with Grant Skinner's easier to use ColorMatrix class ) get the job done ?

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