ios - How to use kCGImageDestinationLossyCompressionQuality in saving GIF from video -


i using regift (https://github.com/matthewpalmer/regift) library convert videos gifs, don't how large file size of saved gifs are. library using cgimagedestinationaddimage function add each frame of video file, , 1 of parameters of function dictionary lets specify properties of image, , 1 of properties can set called kcgimagedestinationlossycompressionquality want use try reduce file size.

this original code in library defines properties dictionary passed cgimagedestinationaddimage function:

let frameproperties = [kcgimagepropertygifdictionary string: [     kcgimagepropertygifdelaytime string: delaytime ]] 

i'm trying modify dictionary include kcgimagedestinationlossycompressionquality property:

let frameproperties = [ kcgimagedestinationlossycompressionquality string: 0.5, kcgimagepropertygifdictionary string: [     kcgimagepropertygifdelaytime string: delaytime ]] 

but when try re-converting same video file gif, there no difference in quality or file size, means setting property had no effect. not setting correctly? or property have no effect gif frames?

i don’t believe can set kcgimagedestinationlossycompressionquality animated gif (going off this answer). might able try compressing or resizing movie file before converting gif.


Comments

Popular posts from this blog

How to show in django cms breadcrumbs full path? -

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -