mtools/examplesb97ef7bb51aamaster
examples
Readme
rm -rf tmp tmp_mov *.png *.avi
- Example 000 #######
modify a single file
mprocimgs --cmd='''img = img_add_text(img,"gas temperature",color=(256,0,0),font="/home/revaz/pgm/python/pNbody-4.0/fonts/Courier_New_Bold.ttf",size=20,center="both")''' png/Fe.png -o img000.png
- Example 001 #######
create a palette
mmkpalette -p rainbow4 --width=512 --height=50 -o palette.png
from a single file, add the palette on the top of the image and write a text
mprocimgs -p p1.py png/Fe.png -o img001.png
- Example 002 ####### #
- add palette, text and create a movie #
create a palette
mmkpalette -p rainbow4 --width=512 --height=50 -o palette.p
from files in a directory, process all files
mprocimgs -p p2.py -d pngs/ -o tmp
and create a movie
gmov2mov -d tmp --only_film --bitrate 10000 --codec x264 -o film002.avi
- Example 003 ####### #
- add a palette on the right of an image, without resizing it #
- create a palette
mmkpalette -p rainbow4 --width=512 --height=50 -o palette.png
from a single file, add the palette on the right of the image
mprocimgs -p p3.py png/Fe.png -o img003.png
- Example 004 ####### #
- crops a part of the image and add it as thumbnail #
from files in a directory, process all files
mprocimgs -p p4.py -d pngs/ -o tmp
and create a movie
gmov2mov -d tmp --only_film --bitrate 10000 --codec x264 -o film004.avi
- Example 005 ####### #
- combine multiple images from different directories #
mprocimgs -p p5.py -d pngs,pngg -o tmp
and create a movie
gmov2mov -d tmp --only_film --bitrate 10000 --codec x264 -o film005.avi
- Example 007 ####### #
- transform an image into grey level #
mprocimgs -p p7.py png/Fe.png -o img007.png
- Example 008 ####### #
- create 3d anaglyph images from two single images #
mprocimgs -p p8.py --dir right,left -o tmp
and create a movie
gmov2mov -d tmp --only_film --bitrate 10000 --codec x264 -o film008.avi
- Example 009 ####### #
- shade an image #
mprocimgs -p p9.py png/Fe.png -o img009.png
- Example 010 ####### #
- add a background image #
create background
mprocimgs --cmd='''img = img_crop(imgs[0],(0,0),(2000,2000));img=img_resize(img,(512,512))''' udf.png -o background.png
proc image
mprocimgs -p p10.py --dir left -o tmp
and create a movie
gmov2mov -d tmp --only_film --bitrate 10000 --codec x264 -o film010.avi
- Example 011 ####### #
- add a black border to transform 16/10 to 4/3 #
from files in a directory, process all files
mprocimgs -p p11.py -d /home/epfl/revaz/data2/dSphC/movie/png_left/ -o tmp
- Example 012 ####### #
- extract left and right images from a pair of images #
mprocimgs -p p12.py --dir /home/epfl/revaz/data2/dSphC/movie/png_g/ -o tmp
- Example movie 001 ####### #
- mount a movie #
mmontage -p m1.py -o tmp_mov
gmov2mov -d tmp_mov --only_film --bitrate 10000 --codec x264 -o film011.avi
- Example movie 002 ####### #
- mount a movie : use transition #
mmontage -p m2.py -o tmp_mov
gmov2mov -d tmp_mov --only_film --bitrate 10000 --codec x264 -o film012.avi
- Example movie from scratch ####### #
- #
fits only
./gmkgmov.py -p filmparam03.py --imdir fits /home/revaz/copy/dSph-1324-8/snap/snapshot_*
compose all fits and create png
./gmkgmov.py -p filmparam03-png.py --imdir png /home/revaz/copy/dSph-1324-8/snap/snapshot_* gmov2mov -d png --only_film --bitrate 10000 --codec x264 -o film013.avi
- loop over files
imgs- loop over frames
- loop over components (# loop over observers)
-> compose components frame['cargs']
-> compose frames film['img_cmd']
- loop over components (# loop over observers)
- loop over frames
- A F A I R E
- 2) ajouter time (using pylab) dans img # #
- appliquer img que a la fin
- 1) faire tout en fits, et appliquer a la fin...
- axes, labels, cbar, time
- transformer en img
- save partial images in png -> give directory
- remove png only
- add time
- use another code to create an image (histogram)
gas-Mg gas-Fe
sta-Fe sta-Mg
img -> img cmd -> include in matplotlib