unixpickle / Giraffe

Encode animated GIF files on the iPhone
261 stars 59 forks source link

Samples for Giraffe #6

Open confile opened 10 years ago

confile commented 10 years ago

Are there any samples for how to use your lib? I only see the short part in the readme which does not help me a lot.

Thank you!

RSully commented 10 years ago

The headers are pretty well commented. If you have a specific question that might be a better starting point for getting help.

confile commented 10 years ago

@RSully sure I have

  1. does your lib compute a gif with 256 colors or full true colors?
  2. will the resulting gif be compressed with LZW encoding? I have seen such a folder in the code?
  3. how do I comvert a UIImage in a ANGifImageFrame?

Thank you for help.

RSully commented 10 years ago

for 3) see UIImagePixelSource, which is mentioned briefly in the readme.

As for the other 2 questions, I'll leave those to @unixpickle

unixpickle commented 10 years ago

@confile here are some answers:

  1. The encoder only supports 256 colors per file and does not use true colors. This is because some decoders do not have good support for tiled images, and the resulting file is usually huge.
  2. I do not use actual LZW compression (mainly out of laziness). Since all GIFs require LZW encoded data, I cheat and generate data that is uncompressed but valid LZW. If you would like, you may implement LZW encoding and make a pull request.
  3. Have a look at the UIImagePixelSource class. The README shows how to add image frames, and the code in ExportViewController.m will show you how to generate an image frame from a UIImage.
confile commented 10 years ago

@unixpickle thank you for your answer. Is there another way to generate true color gifs on ios?

confile commented 10 years ago

@unixpickle I read that the Angif lib supports 24-bit colors would it be easy to include this in your code?

unixpickle commented 10 years ago

I know very little about other GIF libraries, but I'm sure it's possible to port one of them to iOS.