Archived

This topic is now archived and is closed to further replies.

mickey

gif animation files... is there a way to dissect it?

Recommended Posts

i mean, a gif animation file is basically consists of frames which are combined using some gif animations creating tools right? well, is there a way to reverse the process? coz am thinking this way... i''d just download some gif anim at the internet, then dissect it, then convert each of them into bitmaps then put it in my game... rather than draw each frame of animation of my game... or can we instead load this gif animation files directly to our games? ps., pls provide link for more information, thanks!

Share this post


Link to post
Share on other sites

I used gifs for animated purposes.
It would be nice if you could have a nice gif loader.

I used a simple gif animator program that split the individual frames. Most gif animators do this. I then copy/paste into Paint. Saved the bmp and used that. It was a bit of a pain, but it worked.

Guy



Share this post


Link to post
Share on other sites
look for libgif if there is one (should be but I have never looked at it)

If you cant find it, use libmng or libpng (www.libpng.org) and use the example code.

libmng has examples for converting to mng images.

libpng has examples for converting to lots of different png images (this is the best for what you are doing).



Beer - the love catalyst
good ol'' homepage

Share this post


Link to post
Share on other sites
dredge_master, what are those mng/png images are you saying? how do i load that unto my DDraw program? windows knows bmp only right?

arion: plz, can you give a link to a free gif animator that can seperate frames? thanks!

Share this post


Link to post
Share on other sites
The Animation Shop 3 tool that comes with PaintShop Pro 7 will do exactly what you are looking for.

You can load in an animated gif and all the frames are presented to you. Just right click on a frame and choose "Save Frame As..." and there you go.

If you haven''t used PaintShop Pro 7 it''s a great graphics tool. I use it all the time and it has one of the better price tags I''ve seen ($150 Canadian -> which is like 2 cents US I think).

borngamer

Share this post


Link to post
Share on other sites
Oh soz, I didn''t realise you were only looking for an app.

For free ones there is Microsoft GIF Animator (I have no idea where to download it, but try www.download.com though as they probably have it there somewhere). I really liked this one for animated GIF files.

Another free program is one which I use all the time.
http://www.irfanview.com/
It is free, fast, supports lots of formats (including the PNG format) and has plugins if you want to use it for mpegs (including mp3), wav, divx and so on. It also has a basic icon thingy.

Share this post


Link to post
Share on other sites

Dredge-Master, just tried irfanview, nice frame extraction utility. That saves alot of time.

re. The Microsoft GIF Animator, ran into a few broken links hunting it down. But one that worked was:

Rocket

Don''t think I have tried that one.

One of the best I have tried was GIF Movie Gear. I believe I got that from TUCOWS. A trial thing only. But if I found one in the store, I would gladly pay for it.

Guy

Share this post


Link to post
Share on other sites
irfan view?!?!? i have that!!! i just used that to view pictures here, do you mean it can extract frames? how??!?! okey am gonna look at it now... thanks!!!

i also have msgif animator but it doesn''t extract frames,

can windows read other file formats like jpg gif etc.? if so how? i mean are is also LoadImage(....)?

i don''t wanna use bmp or is there a way i can hide my picture files so people won''t see it? like if i give my game to someone, he wouldn''t know those were the graphic files?


Share this post


Link to post
Share on other sites
dredgemaster!!! thank you thank you! i just tried irfan view and i found out under option there is this extract frames! that''s what am being looking for in a software thanks very much!!!

btw, regarding my other two quesiont,

can windows read other file formats like jpg gif etc.? if so how? i mean are is also LoadImage(....)?

i don''t wanna use bmp or is there a way i can hide my picture files so people won''t see it? like if i give my game to someone, he wouldn''t know those were the graphic files?

Share this post


Link to post
Share on other sites
Well, you can make up your own data container sort of file.


When I was working with the Build engine games and when I was on the latest Duke3d team, I wrote some utils that used Ken Silvermans "kens group" format. All the build games that had a single storage file used this.

Basically it was a big file (pretty obvious)
first bit was the header of "KENSILVERMAN"
then there was an integer for the version number

then a long saying how many files were in it - lets call this x

now there was a structure like this
struct{
char filename[14] (it was dos)
long filestart
long filelength
}
and it was in there x times
struct[x]

then all the files were placed into it.


That is one way you can do it.

Another way is you can make your own format. If you are using BMP files, you can just strip the header off it.

You can try some basic encryption if need be, or place them all in a cabinet or even a rar file (source for unrar is free) and use a password on it. Lots of solutions. Oh yeah, if you use unrar, I don''t think you are allowed to for commercial programs.



Regarding the other formats. The only one that is in glaux is for the BMP files.
BUT you can write your own or download libraries for the other formats.
I personnaly use PNG files using libpng and zlib from www.libpng.org (people who created the format in the first place).

My projects that I use now either load BMP (using auxdibloadimage) or my own (auxpngloadimage). I also set up an auto detect and search function so it can''t find the file, it will search for a similar png file, if it fails, then it searches for a bitmap file. If it finds an unknown file it checks its format.

I am planning to upload the source and library for my one some time soon after I check it completely, and write my own dib loader so it won''t require opengl to load the images.


libpng is easy to use

others I haven''t tried but I know exist are
libgif
libjpeg

I have downloaded jpeg, but I haven''t bothered to check its license. PNG (using the original PNG code) is completely free for any purpose, so it is a safe bet if you get it working.

Also, PNG (and MNG, but MNG is still a testing format) are lossless compression, so you don''t loose any quality on the image at all, meanwhile with gif and jpeg you do.

Here is a link to a png image (of a music CD).
http://members.optushome.com.au/jlferry/discs/kilkenny.png

PS - yes that is an audio CD, and yes it does work.


Oh you can also try TGA, but I never use them so I don''t even know if it can compress an image or not.



Beer - the love catalyst
good ol'' homepage

Share this post


Link to post
Share on other sites
whew! it took me so hard to decipher what you just explained, so basically, according to you, for example, i could have one really big file then all my bmps are stored their so basically a windows paint wouldn''t be able to open that coz it''s a different file format!

but but... how does someone do that? dredge master, if you could provide a link or a link to a source code pls if you can provide one, i really wanna learn that style,

p.s, is this what hackers do? break into your files?

i''m sorry it''s just that i don''t know how to do it really, i know just that you use C commands like fopen etc., but how?

Share this post


Link to post
Share on other sites
Yes, I have had people try (and in some places succeed on the less protected ones) to get into file formats and stuff for various things I have made/released a while back. By the old terms some were hackers, the others were "3l33t" newbies or whatever they are called.


Well anyway, about that format I explained above, it is actually very simple to pull the info out of if the person looking at it has the faintest idea what they are doing (well not the faintest but you get the drift)

source code for the above is included with any build game as far as I know. It is with Duke3D and New World IV atleast.

Otherwise, try this site. This is Ken Silvermans homepage. The source for his group files should be in the build source distribution.

While you are there, check out his voxel engines, 6dof with good res (I ran it 1280x1024) and high fps (at 80fps on a p100).


here is is link to Ken''s site
http://www.advsys.net/ken/


There are others, and when I make them now I use my own code for his group format (same format, faster code).
After you compile his kextract and kgroup and test them, the first thing you should do is change his buffer size. don''t use the 32k. You have lots more ram available, so beef it up (either keep it below 640 or go for broke and make it a few meg if you are dealing with bitmaps).

If you can''t write your own code of the extraction of images and stuff, it is pretty simple, just find the starting position of it in the group file. If you are still stumped, look in the code for his editor and game. Should be in there somewhere.



Beer - the love catalyst
good ol'' homepage

Share this post


Link to post
Share on other sites
Oh if you want a more secure format, just use an encrypted CAB file or if you can fork out the cash, buy a license and use RAR. It will also make it smaller as these compress rather well, and extract reasonably fast.

There is zip stuff on kens page too (link previous post) I think. His has no limit on the compressor so it makes the files really small, but takes quite some time to compress them.

Another option is either to bit shift them (not to slow) or use an encrypted random format system, which has the benefits of both encryption and confusing whoever is reading it.



Beer - the love catalyst
good ol'' homepage

Share this post


Link to post
Share on other sites
dredge master, wow, you really invested a lot of time teaching me here, and thank you very much. anyway i understand now what really is the meaning of ''make your own file format'' that is, there are various way to do it, and what you posted here is teaching styles how to do it, now my only problem is, implementing it, again thanks very much!

Share this post


Link to post
Share on other sites
No problem at all. I don''t mind helping people, and since it is holidays at the moment, spending half an hour browsing the forums isn''t much. Otherwise I just hang around with friends, get drunk, watch movies and goto work.


If you want to see the implementation of it, try the above site I posted, with the kextract and kgroup code. They are very small and really simple to follow. Best to learn by example then spend half a day figuring it out for yourself.

Seeya,
James.



Beer - the love catalyst
good ol'' homepage

Share this post


Link to post
Share on other sites