CGM! Composite GIF Machine

by "jim barchuk" <jbarchuk(at)worldnet.att.net>

 Date:  Sun, 7 Dec 1997 16:48:39 -0500
 To:  hwg-graphics(at)hwg.org
 References: 
  todo: View Thread, Original
Hello All!

>From previous msgs:

> > Yes, (see other response on the list). However, if you are creating
> > a background which is a repeating unit of only 2x2 pixels in size,
> > simply save it out as the 2x2 pixel GIF file and let the user's
> > browser do the rest. That way you end up with a tiny file size,
> > which keeps everyone happy.

> But it sure -does- seem like a neat gd application; user selects two
> colors and script returns an appropriate 2048x100 image suitable for
> framing. :) I haven't tried gd before because I never had any need
> for it but will take a try at it over the next week.

I swear this is the -most- fun I've had in a long time. Which pretty 
much explains what a terminal geek I am (pun intended :).

http://www.jbarchuk.com/cgm/

... is the CGM! Compisite GIF Machine.

It accepts two hex triplets colors, a width and height, builds a 
composite gif to those specs, and returns a page using those colors 
for the background, plus a separate image with those colors and that 
size. The image may be snagged by the browser via the background or 
the GIF.

Caveats:

I've written scores of forms, this is the first one that NN2/3 has 
trouble with. Found a reference at netscape.com, it's a timing bug 
fixed in 3.04. It does work, but have to hit the Submit button a few 
times.

Heights and widths are a bit limited. 64, 128, 256, 512, 1024 and 
2048 pixels. I could change it to accept any 'multiple of 4' number 
but that's a bunch of parsing that I don't care to deal with right 
now.

Observation:

NN1.22/Win16 came back with a strange effect. Using one of these
images as a background, there's a 'seam' between the first and second
columns. Happens for any color, -only- the first two columns, for any
size image. Made me think I was doing something wrong but I've looked
at the output very closely and see no problem. Doesn't happen under
the other two versions of Win NN I have, or NN3/Linux, or MSIE2 or 3.
Weird, not gonna lose sleep over it. :)

The future:

I'd could add facility to 'split' the image, any size margin 
(that's two color image), with another optional color at the split 
(that's three colors). If I get a few requests I'll do that.

Could add text to the image, making image maps easy. But gd supports 
limited fonts and I can't add to them.

Enjoy, and have a :) day!

jim barchuk
mailto:jb(at)jbarchuk.com
http://www.jbarchuk.com

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.