Wednesday, July 24, 2013

Blender - Rendering from the command line

Render an Image:
blender -b [directory of file] -o [output] -f [frame number]

Render a Video:
 blender -b [directory of file] -o [output] -s [start frame] -e [end frame] -a

Tuesday, July 23, 2013

Creating a video using a sequence of images and FFMPEG

I've been studying Blender for a while now and have developed a preference of saving the animations as a PNG image sequence instead of video files. Later I can load them in Blender's VSE, o kdenlive, and edit the video.

But sometimes I would rather just see how the animation is going without having to load the files again and render them into a video file.

 ffmpeg -f image2 -i %04d.png animation.mp4

Thursday, February 21, 2013

Optimize PNG files with Pngcrush

One of the problems I face often when working with png files on websites is their size. Gimp, Inkscape, Krita, MyPaint, Blender and many other applications are capable of exporting to PNG but the file is usually quite big.

To solve this problem we can use a simple command line program called Pngcrush.

Installation in debian based systems are as simples as running,as a super user or using sudo, the following command on console:

apt-get install pngcrush

To optimize an PNG image file is as simples as

pngcrush -brute -e "Opt.png" filename.png

-brute - Use force brute. It will be time consuming as it will try 114 different filter/compression methods. The image sice reduction factor is significant using thins option.

-e "ext" - Specifi an extension for all output files. In the above example the new file is going to be called filenameOpt.png. This way you are not going to overwrite the original image.

To optimize all files in the a directory you can use:

pngcrush -brute -d "/home/user/path/to/dir/"  *.png