|
From: Ethan A M. <merritt@u.washington.edu> - 2005-12-29 17:26:40
|
On Thursday 29 December 2005 01:53 am, Daniel J Sebald wrote:
>
> What I'd like is to create an animation consisting of a series of
> images, fairly low resolution, say 20 x 20. Now I've seen a description
> of how to do this on the Gnuplot web page, i.e., a series of GIF images.
> I'd be fine, really, with anything that can be imported into an
> existing "player" so I can play at a rate that would be real-time speed.
The main rationale for using animated gifs is so that they can be viewed
in a web browser. A secondary use is to embed in PowerPoint presentations,
since the other options for embedded movies tend not to be portable enough
to rely on. But if you want to make a proper movie or animation I
would not recommend gif at all.
> Then I could put a "player" in full screen mode. (Any suggestions for a
> GIF animation viewer?
Use the ImageMagick "animate" command.
> So, I have the latest GD library, 2.0.33 and "animate" is activated. I
> was hoping the following Octave commands would generate an example of
> what I want, but it does not work:
>
> graw('unset border\n');
> graw('unset tics\n');
> graw('unset colorbox\n');
> graw('set term gif animate delay 10 nooptimize size 20,20 crop\n');
You definitely do not want to crop and animate at the same time.
In fact, I think we had better forbid that combination.
> Basically, cropping is not done as desired, in my opinion. I know we've
> talked about this before (regarding PostScript), but as I see it "crop"
> should mean tight up against the last "non-white" or "opaque" graphic
> element.
That is exactly what the "set term {png|gif|jpeg} crop" option does.
But it does not make any sense in the context of an animation because
the individual frames do not necessarily have the same border properties.
If you try to crop individual frames then they will not match in size,
and cannot be assembled into an animation.
IMHO cropping of an image, even single non-animated ones, does not
belong inside gnuplot at all. This is clearly a task that has pitfalls
and subtleties, and should better be left to a separate utility that
has been designed to deal with it. I would prefer to remove the option
altogether, in favor of recommending:
set term png ...
set output "| convert -crop 0x0 png:- cropped_image.png"
To make a high quality animation, I suggest writing a script
that creates a sequence of PNG or JPEG images. You can then
combine these into a movie using a single command to the
program "mencoder". Mencoder is part of the mplayer package.
It can also deal with cropping, color correction and a large
collection of other options, and practically any output format
in existence.
> Maybe gnuplot isn't the thing to use for such a feature. Perhaps there
> is a simpler approach in Octave and some output library. (Petr, can you
> think of any?)
I think gnuplot is fine for creating the individual frames
of an animation. But for fine control over the assembled movie,
you need a more sophisticated format than animated gifs.
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|