这是链接(https://imgplay.zendesk.com/hc/en-us/articles/360029411991-What-is-GIF-Dithering-Option-),上面写着When you save the file as GIF with dithering, it can make your GIF more natural.
如何Dithering
使用Objective-C 或 Swift从 UIImages 或视频帧创建更自然的 GIF ?
这是链接(https://imgplay.zendesk.com/hc/en-us/articles/360029411991-What-is-GIF-Dithering-Option-),上面写着When you save the file as GIF with dithering, it can make your GIF more natural.
如何Dithering
使用Objective-C 或 Swift从 UIImages 或视频帧创建更自然的 GIF ?
假设您的源图像是每通道 RGB 8 位,您可以使用 vImage。vImage 没有vImageConvert_RGB88toIndexed8
,但您可以将交错图像拆分为三个 8 位 RGB 平面缓冲区。我不知道这到底有多好用,但是您可以将三个通道中的两个转换为Indexed2
with vImageConvert_Planar8toIndexed2
,将另一个通道转换为Indexed4
with vImageConvert_Planar8toIndexed4
。这将为您提供所需的 8 位查找表。
Apple 在这里有大量的 Accelerate 示例代码项目。优化图像处理性能讨论了将交错图像转换为平面格式。如果您有已知的调色板,使用多维查找表将颜色变换应用于图像可能是将图像量化为 256 种颜色的解决方案。