merging 3 layers

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
A while back I researched and wrote a script that uses gd to make merge
an arrow on a compass to show wind direction, and another on a
speedometer to show wind speed, now I'd like to enhance these "gauges"
even more on the wind speedometer, I'd like to show high and low and
possibly average, and on the direction I'd like to put the prevailing
wind direction.

My weather station can put out the data, but my limitation is I don't
find how to merge another layer onto the image that I am merging to.

how it works now, is I get the background image, use an array of the
direction or wind speed and then from the array look up the position
and rotaion to merge the arrow on to the background and show the final
image.  This is called in the html page like this img
so the speed.php takes the hispeed= and makes the image that is asked

Do I have to write out the file and then call it again to merge the 3rd
layer?  If I do that do I have to specify a location to save the
temporary file to?

Does anyone have an example of this?

here is the page that uses the script that I put together.

I can provide the files also if needed.

Re: merging 3 layers contained the following:

Quoted text here. Click to load it

Seems a wasteful use of GD where the number of images required is fairly
small.  Even with one degree accuracy you are only talking 360 images.
Much easier to create them  and then reference them from the filesystem.
Or do as you are doing now and save the image created and check if it
exists before making a new one.

The other information you want to add seem like just plain text, so I'd
add it with html and CSS.

If you insist on creating all images on the fly then to avoid saving and
doing the merge twice you'll have to look at the code that produces the
merge and add the second merge before the final output to .jpg
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs

Re: merging 3 layers

The additional information now is text because I didn't find a way to
merge the additional arrows, it is just a stop gap, and on the
directional arrows I'm only doing 16 directions, not all 360 degrees,
but when I figure out how to add more layers then I'll want to add the
last 3 directions and a prevailing direction, so I don't want to be
limited. Besides it isn't as if the machine is working hard on anything
else it does.

But I like the idea, that if the same combination is asked for again
that it can just read the image from the drive and display it rather
than regenerate it.  Do you have sample code that can do that?

Geoff Berrow wrote:
Quoted text here. Click to load it

Site Timeline