Monday, 21 December 2009

3D animation creation service

Through something completely unrelated I found the xtranormal webpage, which lets you create simple 3D animations in a very easy way. In a minute you can create something really simple (for example: a greetings message). Creating a personalized cartoon for the kids goes now into the TO DO list...

Saturday, 19 December 2009

Backing up with rdiff-backup remotely

For some time I wanted to make a decent setting to create daily backups of my different computers, but somehow kept delaying it... Not any more...

In the end, it is actually pretty easy to set up (though I still need to verify that doing it automatically instead of manually does not give me any trouble).

I basically mount a remote directory in my local tree with sshfs

sshfs remote_machine:/net/angelv/BACKUPS /BACKUPS/NAS/ -o workaround=rename

The -o workaround=rename is important, as previously I was having trouble doing this sort of backup through sshfs (see this).

Once this is in place, having daily incremental backups is as easy as putting in my cron:

0 2 * * * rdiff-backup /home/angelv /BACKUPS/NAS/VASO.HOME.BACKUP
0 3 * * * rdiff-backup --remove-older-than 4W /BACKUPS/NAS/VASO.HOME.BACKUP

See more examples.

Friday, 18 December 2009

Missing libraries libstdc++5 in Ubuntu 9.10 when installing Intel Compiler

The installation script (for 64 bits) complains about libstdc++5 not being present, and it cannot be found in the default repositories. Installing the one for the previous Ubuntu version works fine. The details can be found, for example, in here.

After that, if you want to run the debugger, you also need to install the 64 bits version of libstdc++5, which can be installed automatically (all dependencies should be met) with GDebi, after downloading the package from here.

Thursday, 17 December 2009

Photo Mosaic creation tips

Related to my previous post, I spent some time figuring out how to get a good photo mosaic. Basically I wanted to create a Mosaic of a family picture, where the "metapixels" (i.e. the small images) would be pictures of the members of the family. The resulting image (about 75cmx100cm) was to be framed and put up at our home, in a corridor with maximum viewing distance of around 5.5 metres. And basically I wanted to make sure that the family picture could be properly appreciated when viewed from a distance, but also that the "metapixels" could be seen when looking at it close-up. So, I had to follow these steps:

1. Select all possible metapixel images (this is trivial but it takes some time: I wanted to make sure that all metapixels were related to the bigger images).

2. I found that many of my images had spaces in their names, which the metapixel software didn't like, so I substituted the spaces with underscores:

rename -v 's/\ /\_/g' *

3. I don't want the metapixels to be streched (metapixel will only work with one metapixels size) so I find for my set of images which sizes they have and how many I have of each size:

angelv@palas:~/Mosaic$ for img in `ls Mosaic-Original/` ; do identify -format "%wx%h" Mosaic-Original/$img ; done > sizes.txt

4. I find how many of them have a 3x4 ratio, and how many a 4x3 ratio. In my case, these numbers are very similar: 1089 (4x3) vs. 1051 (3x4)

5. Despite the number of landscape images being a little bit larger, I decide to build the mosaic out of the portrait ones, since portrait images are usually close-ups, and will be appreciated better when very small. To copy all the 3x4 images I use:

#!bin/bash

find Mosaic-Original/ -exec identify "{}" \; |awk '{
split($3,arr,"x")
split($1,name,"/")
if ( arr[1] < arr[2] ) { cmd = "cp " $1 " Mosaic-Original-3x4/"name[2] system(cmd) } }'


6. So now I can create the thumbnails with the correct ratio:

angelv@palas:~/Mosaic$ metapixel-prepare -r Mosaic-Original-3x4 Mosaic-Thumbs --width=96 --height=128

7. And now I can prepare the final mosaic image, but with the right ratio for the thumbnails:

metapixel --metapixel mosaico_in.jpg mosaico_out_cheat40.png --library Mosaic-Thumbs/ --scale=5 --distance=5 --width=48 --height=64 --cheat=40

The numbers are important...

* As I mentioned, the final picture has to be 75x100. My original image was 1857x2476 pixels. When asking metapixel to scale it by 5, the resulting mosaic has 12384x9280 pixels, so for 100cm (or 39.37 inches), this image can be printed at 314 dpi (300 dpi is considered a very good quality for printing).

* At the same time, each row of the mosaic will have 258 metapixels (12384/48), so each metapixel will be 3.87mm wide, which is small, but definitely viewable when you get close enough.

* A 40% cheating is quite large, but my set of images was not very large, and the distribution of colours was not very good, so when no cheating was used, the resulting image was very poor in colours, so I modified the original image to make its colours brighter, and I used a 40% cheat percentage, so the resulting image can be easily viewed from a distance, and it has plenty of colours. The artifact can be appreciated when getting close to the picture, but I think this is better than having a resulting mosaic with very poor colours.

The resulting image looks very nice, and I sent it yesterday to develop it (which is cheaper than I thought, just about 30 Euros).

Thursday, 10 December 2009

Photo Mosaic Software

I needed to create a Photo Mosaic today, and I just found the Metapixel software. I'm not sure how this rates quality-wise against other tools, but in a matter of minutes I had created a test Mosaic with whatever pictures I had on my hard disk following this post. Really nice! Now we have to spend tweaking the different options to get the desired result...

Train simulators in Linux

My son is a train fanatic, so I decided to check train games in Linux for him. For our Ubuntu computer at home there were two packages readily available: Ri-li, but better still openBVE.

Ri-li is a simple game, but for a 4-years-old perhaps still a bit difficult.

openBVE is a proper train simulator (definitely too difficult for my son to control, but probably fun as a vicarious driver), and it was installed properly on Ubuntu 9.04 through the Synaptic Package Manager, but not in 9.10, so I had to install it through Wine. All is clearly explained in Rail Sim Routes. This YouTube Video shows it off!

Tuesday, 8 December 2009

Ripping a DVD with many tracks into a single AVI file

Since I'm likely to forget... Starting a few months ago, I now make a copy of every CD or DVD that I buy. This is normally a no-brainer, but today I had to copy a DVD that has many content tracks (usually the "interesting" content is in just one of the big tracks, while the "auxiliary" tracks can be discarded). I normally use dvd::rip, but for this I realized that AcidRip was a better option, since it lets me queue the ripping of all the tracks and then I can go away until they are finished (with dvd::rip I didn't find a way to do that). Once all the tracks are ripped into individual AVI files, I tried to put them all together with the aptly named avimerge, but I found (and apparently this happens to other people as well) that the audio gets broken, so I did it with menconder (got the thip from here):

mencoder -oac copy -ovc copy part1.avi part2.avi part3.avi -o WHOLE-THING.avi