Thursday August 23, 2007 | Constantin's Blooog |
|
Useful stuff for your blog-reading pleasure.
All
|
General
Cool Apple-Like Photo Animations With POV-Ray, ImageMagick and Solaris
Recently we took a team photograph for an internal web page. I wanted that effect and I love the open source raytracer POV-Ray so I wrote a script that renders the same animation effect and creates an animated GIF using ImageMagick. You can see an example output to the right featuring photos of some popular Sun products. BTW, check out photos.sun.com for free, high-quality access to Sun product photography. To create your own photocubes, you just need POV-Ray and ImageMagick in your path and the photocube.sh script. Being open source, all run on Solaris but also on Linux, NetBSD or any other operating system that can run open source software. I'd love to try this script out on a Niagara 2 system with its 8 cores, 16 pipelines, 64 threads and 8 FPUs. Hmmm, all rendering frames in parallel :). There are already precompiled distributions of POVRay and ImageMagick on Blastwave that you can install very easily onto your Solaris machine if you don't have them already. Just call the script with 6 URLs or pathnames. It will then automatically read in the images, render the animation frames and then combine them all into an animated GIF: -bash-3.00$ ../photocube.sh *.jpg The script uses ImageMagick to make the pictures quadratic and to limit their size to 1200x1200 pictures if necessary. Since the Feel free to modify this script to your needs. You may want to experiment with other ways of animating the cube or other image transition effects. Maybe you want to use ffmpeg to create real video files instead of animated GIFs. Be careful when cranking up the number of frames while using ImageMagick to create animated GIFs, ImageMagick wants to suck in all frames into memory before creating the animated GIF and so you may end up using a lot of memory. If someone has a more elegant, scriptable animated GIF creator, please leave me a comment. I hope you enjoy this little exercise in raytracing and animation. Let me know if you have suggestions or other ideas to improve this script!
"Cool Apple-Like Photo Animations With POV-Ray, ImageMagick and Solaris" has been brought to you by Constantin's Blooog.
This entry was created on 2007-08-23 13:20:47.0 PST and is associated with the following tags:
apple
cool
diy
howto
imagemagick
iphoto
opensolaris
opensource
photos
pov-ray
raytracing
script
slideshow
solaris
Post a Comment: Comments are closed for this entry. « ZFS Snapshot Replica... | Main | 7 Easy Tips for ZFS... » |
|
Hi,
You forgot to mention you need the curl package from blastwave also.
Apart from that it works great for me:-)
Cheers
Richard.
Posted by Richard Skelton on August 24, 2007 at 01:14 AM CEST #
Hi Richard,
ah yes, thank you for pointing that one out. And thank you for trying it out!
Constantin
Posted by Constantin Gonzalez on August 24, 2007 at 08:19 AM CEST #
Hi Constantin,
I tried the photocube.sh script on my Linux boxes.
First it was missing a "`" in line 57:
if [ "`echo $i | cut -c1" = "/" ]; then
Should be:
if [ "`echo $i | cut -c1`" = "/" ]; then
Then I had an issue with my SuSE 9.3 server caused in an older ImageMagick version (6.1.8) where convert does not know about "-extent" option.
After moving to a openSuSE 10.2 laptop (ImageMagick-6.3.0.0-27.6, povray-3.6.1-36) this all went well.
Thanks for this nice hint.
Regards,
Juergen
Posted by Juergen on September 11, 2007 at 12:08 PM CEST #
Hi Juergen,
thank you for your comment and for pointing out the quote bug. I didn't run into it yet, not sure why. Maybe there's a difference in the way your shell interprets errors in if statements vs. the bash implementation that I normally use on Solaris.
The -extent option is very useful and I admit that I didn't bother trying to implement the size adjustment without it :).
Have fun and let me know about the animations you've created. If I get a couple of nice animations, I might put them up in a later post.
Cheers,
Constantin
Posted by Constantin Gonzalez on September 12, 2007 at 11:47 AM CEST #