help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying an animation / "movie"


From: Joshua Rigler
Subject: Re: Displaying an animation / "movie"
Date: Wed, 03 May 2006 09:24:23 -0600
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc3 (X11/20050929)

Robert S. Weigel wrote:
In Matlab I was never satisfied with the movies created using imshow. I prefered the finer-grained control of using epstk to create 1 eps file per frame and then png2swf [http://www.swftools.org/] after converting .eps to .png with the ImageMagick command line program "convert" . Using this method I am able to create full-screen movies without muddled text and lines. (Also, if I ever want to re-create a movie when typical monitors are 16000x12000 pixels, I just need to run a script that operates on the vector .eps files and change the -density parameter.)

Here is my .m and shell script I use to automate the process:

for i = 1:99
FileName=sprintf('./figures/Figure_%03d.eps');
% postscript file creation commands
end

#!/bin/bash

DEN=200

cd ./figures
for k in $(ls *.eps); do
    echo "Converting $k";
    convert -density $DENx$DEN $k $k.png;
done
png2swf -o all_X_$DEN.swf -r 12 *.png


...and for the archives...

For those using certain versions of Fedora Linux, you may have long ago noticed that something was broken with Imagemagick's 'convert' routine whenever converting from .eps to some sort of rasterized format. The resolution was bad no matter what you set '-density' equal to, black lines were changed into white lines, and a whole slew of other things that resulted in an image of very poor quality. I'm still not sure what the problem was/is with convert, but the equivalent ghostscript command to 'convert -density 300 test.eps test.png' goes as follows:


shell prompt> gs -q -dBATCH -dNOPAUSE -dEPSCrop -sDEVICE=png16m -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r300x300 -sOutputFile=./test.png test.eps


A description of most of these options can be found in the ghostscript documentation, but the ones you might want to play with are:

-sDEVICE - type of output file;  a list of supported file types can
           be found in a file called devs.mak, which is not always
           distributed with ghostscript binaries, but can be easily
           found at www.ghostscript.com in their CVS archives.

-dTextAlphaBits - sets text antialiasing level; 1, 2, and 4 are valid
           values, each performing a little more antialiasing

-dGraphicsAlphabits - sets graphics antialiasing level; 1, 2, and 4
           are valid values

-r       - sets resolution in dpi; it can be just a single value, or
           a pair of dimensions separated by an 'x'

Sorry for the somewhat off-topic post/reply, but after all the effort I wasted to figure out that 'convert' was indeed the broken culprit, and then figuring out the equivalent ghostcript command, I thought this information might be helpful to others on this list.

-EJR


reply via email to

[Prev in Thread] Current Thread [Next in Thread]