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

GIF support request #1

Closed
jerrychan7 opened this issue Apr 7, 2022 · 10 comments
Closed

GIF support request #1

jerrychan7 opened this issue Apr 7, 2022 · 10 comments
Labels
enhancement New feature or request

Comments

@jerrychan7
Copy link

gif?gif。gif!

这么好玩的东西怎么能少了动图?

固定水印,逐帧渲染,计划通√

@itorr
Copy link
Owner

itorr commented Apr 8, 2022

gif 在原理上有些不太适合,本身颜色是依靠色板存储的,无论是加水印还是绿化都会导致画面严重崩坏,在支持之前要先摸索一个可行方案🥺

@itorr itorr added the enhancement New feature or request label Jun 1, 2022
@HomeArchbishop
Copy link
Collaborator

可以考虑把gif拆解成jpeg/png,再逐层绿化,然后合成。
我做了一个简单的小样,效果还行。色彩崩坏没看出来🤔
需要优化的就是渲染速度,太慢了🤯。考虑上web worker🙄

@HomeArchbishop
Copy link
Collaborator

HomeArchbishop commented Jul 27, 2022

哈哈我收回「没遇到崩坏」这句话🥲

年份 画质 结果
原图 原图 chiya
15 76% 15-76%
15 16% 15-16%
74 76% 74-76%
74 8% 74-8%

不知道这个包浆效果是好是坏了🤯

只有熊猫头这种没色彩的挺好,就是像素太低了,水印看不清。(◐‿◑)

话说其实静态图片这样搞也是一样的效果,那gif可能就不算崩溃了吧(捂脸
70-2%-static

@itorr
Copy link
Owner

itorr commented Jul 27, 2022

TAT 写着回复发现有了新进展 重头来ψ(`∇´)ψ

主要麻烦的地方在于 jpeg 的波纹痕迹和水印会带来大量的杂色,gif 色板看到直摇头🤕
gif 我记得是可以支持区域色板的,倒是也可以牺牲文件大小 换回一定的画质😟
在色板不变的情况下 也可以适当的给图像增加抖动,也可以让整体的信息保留更多

@itorr
Copy link
Owner

itorr commented Jul 27, 2022

其实画质超低时色板数反倒直线下降,特别适合 gif 了🤣

@itorr
Copy link
Owner

itorr commented Jul 27, 2022

咦,好像现在的样例已经是用了区域色板的图像了🤔 作为输出结果来说我觉得是完全可用的

@HomeArchbishop
Copy link
Collaborator

HomeArchbishop commented Jul 27, 2022

那如果不是区域色板,也没法转换啊😔
看来失真是不可避免了

诶,生成的图片也是区域色板吗(◐‿◑)

@itorr
Copy link
Owner

itorr commented Jul 27, 2022

那如果不是区域色板,也没法转换啊😔 看来失真是不可避免了

诶,生成的图片也是区域色板吗(◐‿◑)

其实现在的样例看起来已经是可用的了,有些 gif 特有的劣化其实也很契合这个项目来着。原本的劣化就包含 jpeg 的压缩来着👻

@HomeArchbishop
Copy link
Collaborator

确实,这么垃圾的画质更像包浆。。。(◐‿◑)

我整理整理,看看发个草稿 pull request。我是单独放了一个文件,没有在 patina.js 里增改。

( 你说未来要解耦来着,未来你有空解耦好了我再 pull request 也可以( ´▽`) )

@itorr
Copy link
Owner

itorr commented Aug 3, 2022

#7 以支持

@itorr itorr closed this as completed Aug 3, 2022
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

3 participants