Creating an animated gif?

739 views
Skip to first unread message

Matthew Leibowitz

unread,
Feb 11, 2017, 11:34:55 PM2/11/17
to skia-discuss
I just wanted to check if Skia provided a way to save an animated gif? There doesn't appear to be in the encoder - which only saves the bitmap anyway. But, maybe I missed it...

Matthew Leibowitz

unread,
Feb 11, 2017, 11:57:05 PM2/11/17
to skia-discuss
f there is no way from within skia, I could always use the giflib directly.
If this is the case, where is a good place to get docs/info on how to do this? - you can't always believe what you read on the internet :)


On Sunday, February 12, 2017 at 8:34:55 AM UTC+4, Matthew Leibowitz wrote:

Matthew Leibowitz

unread,
Feb 12, 2017, 3:08:21 AM2/12/17
to skia-discuss
Busy looking through the commits and I see giflib was removed - mine was still around from previous versions.

So, it appears that it is only possible to read .gif files.
What would be a suggested/recommended route for saving gif files?

Dean McNamee

unread,
Feb 13, 2017, 7:57:17 AM2/13/17
to skia-d...@googlegroups.com
In general for writing images you might want to have a look at a
library like FreeImage. An example of using FreeImage to write out
images from Skia pixels:

https://github.com/deanm/plask/blob/46e3ff5cf8728c46c969f69e2bd7595479494c86/plask_bindings.mm#L316
https://github.com/deanm/plask/blob/46e3ff5cf8728c46c969f69e2bd7595479494c86/plask_bindings.mm#L6482

That code doesn't support GIFs directly, but it shouldn't be hard to
do with FreeImage.
> --
> You received this message because you are subscribed to the Google Groups
> "skia-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to skia-discuss...@googlegroups.com.
> To post to this group, send email to skia-d...@googlegroups.com.
> Visit this group at https://groups.google.com/group/skia-discuss.
> For more options, visit https://groups.google.com/d/optout.

Hal Canary

unread,
Feb 13, 2017, 8:54:45 AM2/13/17
to skia-discuss
We never supported encoding to single-frame GIF, since the format requires indexed color and we don't provide an algorithm that creates an indexed color palette.

You'll have to talk to giflib yourself.

Alternatively, you can save a sequence of PNG files and ask a third-party tool, such as ImageMagick to convert that sequence to an animated GIF.

On Sat, Feb 11, 2017 at 11:34 PM, Matthew Leibowitz <mattl...@live.com> wrote:
I just wanted to check if Skia provided a way to save an animated gif? There doesn't appear to be in the encoder - which only saves the bitmap anyway. But, maybe I missed it...

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages