|
From: Daniel J S. <dan...@ie...> - 2005-12-29 20:22:57
|
Ethan A Merritt wrote:
> 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.
I thought GIF seemed kind of skimpy as far as an image format. Not scientific graphics, for sure.
> 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.
Well, I agree with that, I guess. A person could easily string together a series of plots having no visual reference whatsoever.
In one sense, "animate" should be a mode that freezes the border characteristics. But then one could not animate, say, zooming in on a portion of a graph. Then again, that really is getting sophisticated as a would-be gnuplot use.
>
> 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.
No doubt. However, cropping of images is such a useful thing that it could have it's special case in the gnuplot core. That is, if there is nothing on the plot but an image (easy enough to test if I remember correctly), there could be special code to just plot an image to a file and be done with it. (Force the output resolution to match the image.) Just bypass all of the plot layout and so on (unless the terminal deems that necessary, although I can't see why).
> 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.
OK. Thanks Ethan. I'll try these out. Why not add this to the FAQ? I think this is a fairly common task...
Well, JPEG is out. The help has nothing about lossless images, but JPEG has interpolation and is not acceptable in this application. (Of course, if somehow we could generate output that matches the size of the image, perhaps JPEG will not have this effect.) Actually, the result isn't that good either, the left side of the JPEG images look to have a "half" pixel. The image is not square overall either.
PNG seems to produce the best result of all so far. But even still I have to set the resolution high enough to get anything meaningful. If I set it at 20 x 20 (JPEG or PNG) I get complaints from the respective image library about empty data. If I set it at 40 x 40 I get very strange looking figures that appear more like some kind of color box. (See attached PNG.)
>>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.
Yeah. What is the animated GIF for, really, in terms of gnuplot? I mean, assembling a movie is a far more meaningful thing in the scientific community than an animated graphic for a web page.
Alright, let me look at generating movies with ImageMagick...
Dan
|