BBC BASIC for Windows
Programming >> Graphics and Games >> Manual GIF creation
http://bb4w.conforums.com/index.cgi?board=graphics&action=display&num=1349059953

Manual GIF creation
Post by JGHarston on Oct 1st, 2012, 02:52am

Anybody know anything about low-level GIF format?

BBCtoBMP successfully converts BBC screen dumps to BitMap files. A couple of years ago I started trying to do the same to create GIF files. I gave up. I've started again.

China.gif is supposed to be an uncompressed GIF. It's supposed to be the GIF version of China.bmp. As far as I can tell, I'm outputting what all the documentation and code samples tell me is what an uncompressed GIF should be. But everything I try to view it with says it isn't. A simple GIF extractor that I wrote manages to successfully extract the image data, but then I'm extracting what I expect I've put in there.

Can anybody help. What is wrong with China.gif that makes it not a GIF?

Thanks.

...and don't say "use a GIF library", a GIF library is what I'm trying to write.

Re: Manual GIF creation
Post by admin on Oct 1st, 2012, 08:36am

on Oct 1st, 2012, 02:52am, JGHarston wrote:
Can anybody help.

Not directly, but this is what I'd do in your position. Download a trusted, good, uncompressed GIF such as this:

http://upload.wikimedia.org/wikipedia/en/b/bb/Quilt_design_as_46x46_uncompressed_GIF.gif

Convert that back into whatever source format your program uses (e.g. BMP) and then create your own uncompressed GIF version. By comparing yours with the original you may be able to see what is wrong.

Richard.
Re: Manual GIF creation
Post by JGHarston on Oct 8th, 2012, 12:38pm

on Oct 1st, 2012, 08:36am, Richard Russell wrote:
Download a trusted, good, uncompressed GIF such as this: ...
He he. That's exactly what I did, ultimately ended up manually adding and removing single bytes at a time. It turns out that the documentation I was working from had a misplaced bracket, putting "Initial Code Size" as a prefix to every code block instead of as a single prefix before the first code block. uncompressed GIFs now working, so just need to get the LZW working. Compressed bitmaps were so much easier, just simple run-length encoding smiley