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

Thursday 3 December 2009

Manifiesto “En defensa de los derechos fundamentales en internet”

Ante la inclusión en el Anteproyecto de Ley de Economía sostenible de modificaciones legislativas que afectan al libre ejercicio de las libertades de expresión, información y el derecho de acceso a la cultura a través de Internet, los periodistas, bloggers, usuarios, profesionales y creadores de internet manifestamos nuestra firme oposición al proyecto, y declaramos que…

1.- Los derechos de autor no pueden situarse por encima de los derechos fundamentales de los ciudadanos, como el derecho a la privacidad, a la seguridad, a la presunción de inocencia, a la tutela judicial efectiva y a la libertad de expresión.

2.- La suspensión de derechos fundamentales es y debe seguir siendo competencia exclusiva del poder judicial. Ni un cierre sin sentencia. Este anteproyecto, en contra de lo establecido en el artículo 20.5 de la Constitución, pone en manos de un órgano no judicial – un organismo dependiente del ministerio de Cultura -, la potestad de impedir a los ciudadanos españoles el acceso a cualquier página web.

3.- La nueva legislación creará inseguridad jurídica en todo el sector tecnológico español, perjudicando uno de los pocos campos de desarrollo y futuro de nuestra economía, entorpeciendo la creación de empresas, introduciendo trabas a la libre competencia y ralentizando su proyección internacional.

4.- La nueva legislación propuesta amenaza a los nuevos creadores y entorpece la creación cultural. Con Internet y los sucesivos avances tecnológicos se ha democratizado extraordinariamente la creación y emisión de contenidos de todo tipo, que ya no provienen prevalentemente de las industrias culturales tradicionales, sino de multitud de fuentes diferentes.

5.- Los autores, como todos los trabajadores, tienen derecho a vivir de su trabajo con nuevas ideas creativas, modelos de negocio y actividades asociadas a sus creaciones. Intentar sostener con cambios legislativos a una industria obsoleta que no sabe adaptarse a este nuevo entorno no es ni justo ni realista. Si su modelo de negocio se basaba en el control de las copias de las obras y en Internet no es posible sin vulnerar derechos fundamentales, deberían buscar otro modelo.

6.- Consideramos que las industrias culturales necesitan para sobrevivir alternativas modernas, eficaces, creíbles y asequibles y que se adecuen a los nuevos usos sociales, en lugar de limitaciones tan desproporcionadas como ineficaces para el fin que dicen perseguir.

7.- Internet debe funcionar de forma libre y sin interferencias políticas auspiciadas por sectores que pretenden perpetuar obsoletos modelos de negocio e imposibilitar que el saber humano siga siendo libre.

8.- Exigimos que el Gobierno garantice por ley la neutralidad de la Red en España, ante cualquier presión que pueda producirse, como marco para el desarrollo de una economía sostenible y realista de cara al futuro.

9.- Proponemos una verdadera reforma del derecho de propiedad intelectual orientada a su fin: devolver a la sociedad el conocimiento, promover el dominio público y limitar los abusos de las entidades gestoras.

10.- En democracia las leyes y sus modificaciones deben aprobarse tras el oportuno debate público y habiendo consultado previamente a todas las partes implicadas. No es de recibo que se realicen cambios legislativos que afectan a derechos fundamentales en una ley no orgánica y que versa sobre otra materia.

Este manifiesto, elaborado de forma conjunta por varios autores, es de todos y de ninguno. Si quieres sumarte a él, difúndelo por Internet.