- Online Community Forums » Programming Questions » About GIF,i need help.

This thread is locked; no one can reply to it. rss feed Print
About GIF,i need help.
Member #16,794
January 2018

Hello. :)

Gif plug-in on the wiki, some people understand?
It is obviously imperfect, or my picture is not very good.

Pictures like a slide show, each cycle will flash.
Can not even see the picture completely.

I am not a professional artist.I drew a day's time, drew 16 pictures.
But, he can not use it. :-/

What special gif does this plugin need?
I use the "ps cc" to make gif: Set: 8-bit color, 210 * 210 size, 75 pixels / foot.

Can you help me? :-[
GIF normal use in web browser.
my picture 228kb.

Member #907
January 2001

ps cc = I think you mean Adobe Photoshop CC.
"Gif plug-in on the wiki" = ?

When you compile the algif example and run it with your image, do you get the problem ?
In this case, you probably have the issue that Photoshop saves images with maximum compression. With GIF format, it is possible to make smaller file by only saying which pixels are different, example:
Image 0 : full
Image 1 : only differences from image 0 (GIF calls it : Disposal method : Do not dispose)
Image 2 : only differences from image 1
Image 3 : full
Image 4 : only differences from image 3
Image 5 : only differences from image 4

If you look at images 1, 2, 4, or 5, they look 'ugly'. To show the "actual" image 5, you have to draw image 3, then image 4 on top of it, then image 5 on top of it.

One solution is to find a graphic program which always saves full images. If you can't find one that you like, then it is not a good idea to store game animations in GIF, sorry :(
It will be much easier to export animations as individual images (run000.png, run001.png etc) and use a loop to load them :

char fname[256];
int i = 0;
for(i=0; i<6; i++) // 000 to 005
  sprintf(fname, "run%.3d.png", i); // run000.png
  run_anim[i] = al_load_bitmap(fname);

Edgar Reynaldo
Member #8,592
May 2007

You can use ffmpeg to convert a .gif into an .ogv. Then you can play it directly with allegro without the gif addon.

Member #16,794
January 2018


Thank you for your answer.I benefit greatly. :)
@Edgar Reynaldo

I understand your meaning, but can not but acknowledge the lack of Allegro, maybe I will write something to share later.
After all, this is a public undertaking.Is not it? ;)

But, I'd like to know more about what you mean by .ogv in Allegro.
Allegro simply because the manual says that it supports, but did not say how.

When I finished studying these things, I might go perfect manual.
However, this requires you to understand and correct my language

Edgar Reynaldo
Member #8,592
May 2007

Go to: