Tag Archives: gif

3D effect on GIFS

It has been while since I saw 3D effect in GIFs, like the ones below made from stereoscopic images.

(Nude by Auguste Belloc circa 1855)
(Nude by Auguste Belloc
circa 1855)
(“An Artist in his Line”,1898 Strohmeyer & Wyman)
(“An Artist in his Line”,1898
Strohmeyer & Wyman)
(“Patchwork”,1898 Strohmeyer & Wyman)
(“Patchwork”,1898
Strohmeyer & Wyman)

I think it is a nice trick and I have been wishing to reproduce it for a while.

It seems now it is as easy as downloading an APP called Google Camera

google camera

With this application you will take a picture and then pan the camera a little bit. This creates a special kind of picture that allow you to create the 3D effect.

To complete the effect and generate a GIF, you only need to load the picture into an online software called Depthy.

depthy

Nice and easy. Do you remember my Post about 3D with Catch? Here it is the same army but with this effect.

(image credit: Héctor Corte-León)
(image credit: Héctor Corte-León)

The Princess Bride

DSC_0269
Original title: The Princess Bride

Title of this edition: The Princess Bride

Author: William Goldman

Gender: Fantasy/Adventure.

Saga: —

Editorial: Houghton Mifflin Harcourt

Edition year: 1, 2007.

Prizes: …

Synopsis [Warning: Spoiler]: This book is written as a story inside a story, so this edition speaks about how Goldman wrote the book, and he pretends it was actually an adaptation from an older one. At the same time, the movie tells us the story as a grandpa reading the book to his grandchild. And it’s like this:

Buttercup is going to become the most beautiful woman in the world… when she grows up. Right now she is only the daughter of a farmer, and Westley is a homeless boy who works for Buttercup’s father. But none of that matters, because Westley is the only who loves Buttercup as she is, and also… Westley is the only one that Buttercup loves.

the-princess-bride

But there is a problem. Wesly doesn’t have anything, so he cannot offer anything to her. The only way for Westley to prove he is good enough for Buttercup is leaving to America searching for fortune… but his boat is attacked by the Dread Pirate Roberts who never makes prisoners.

Knowing about Westley’s dead Buttercup wishes to die, but she is so beautiful that the prince know about her and ask her to be his wife.  She doesn’t want this marriage, but also she doesn’t want to disobey her prince. What she doesn’t know is that the passion of the prince is not for her but for hunting and war and he has a secret plan to kill her and make it look like a plot from another country.

images

That is why Vizzini, Iñigo and Fezzik kidnap the princess and are going to kill her. But they didn’t count with the masked man in black. He is able to follow Fezzik climbing the cliffs of insanity, he can beat Iñigo Montoya, the best swordsman in the world. The defeat Fezzik the giant in a hand to hand battle, and he kills Vizzini in an intellect battle.

Westley_and_Inigo_duel_atop_the_CLiffs_of_Insanity.

Who is this masked man that did all this to rescue the princess? It’s the Dread Pirate Roberts (who never makes prisoners). Well… not exactly. Westley boat was captured by Roberts and when he was about to kill Westley he said “please, I need to live”, and being the only one that didn’t try to bribe Roberts for his live, he was curious and allow him to live one day more. Every day Westley learned something from Roberts, and every night Roberts said “well done Westley, I’m not killing you today, but maybe tomorrow”. And so was life for 5 years.

After those years of serving Roberts, he revealed the secret to Westley “I’m not the Dread Pirate Roberts, I inherit the name and the ship from the previous Pirate Roberts, who also was not the Dread Pirate Roberts. The real Pirate Roberts is retired living like a king with his bounty”. And he said also “you know, in piracy the inly important thing is the name” and he start calling Roberts to Westley and hire a new crew for him and he became Roberts.

When Buttercup finds this she becomes the most happy girl in the world. She is in love with Westley, she really never love the prince, and Westley loves her, he overpass all this just to rescue her.

7039173853_57bdab5a17_o

It’s a moment of great passion. Love reunited, love against every challenge in the world. Love.

But the story doesn’t finish here, The princess is trying to chase them. At the beginning was fake, just to cover his plot, but now he has to recover the princess and kill her himself. Westley has his ship ready to scape, but they need to cross the fire swamp to reach it and they didn’t manage to do it in time. The prince has them.

To save Westley’s live, Buttercup accept to marry the prince if he let Westley go.

But is all a tramp. Westley is sent to Count Rugen (Prince right hand). The count has been studying pain all his life and wants to become immortal writing a book about pain. That’s why he has created a machine that sucks life and produces the most horrible pain.

For months, while the wedding is being arranged, Westley supports all this pain, broken bones, blood, hurts… He was trained to do that… but he was not trained to support loosing Buttercup and that is what they use to break him. He starts suffering when they tell him that Buttercup doesn’t love him anymore. And the pain is so intense that they torture him to death.

With Westley dead, Vizzini dead and the princess ready to become queen, the plans of the prince to start a war quilling the queen are ready…. But he didn’t count with Fezzik and Iñigo.

817314467751400c8c88f33fb87e8764

Iñigo is the best swordsman in the world for one reason, avenge his father who was killed by the man with six fingers… the man who is torturing Westley… count Rugen. But count Rugen is in the castle with the prince, and the castle is protected with by brute squad. With Vizzini death, who is intelligent enough to enter the castle with only 2 men? The dread Pirate Roberts!

They find Westley just to discover he is dead. But Iñigo is not going to fail! Miracle Max has to revive him. But before doing a miracle, and without so much money… there must be a reason for helping Westley. With his instruments, Miracle Max manages to give a little life to Westley, enough for a couple of words “true love”.

With Westley coming back from death and only a few hours up to the wedding, the chances of killing Count Rugen, stopping the Prince and rescuing the princess are almost null.

But the man who defeated Vizzini has a plan, and they manage to enter the castle and Iñigo faces the count and Westley meets the prince. Almost diying Iñigo manages to kill the count

“Hello. My name is Inigo Montoya. You killed my father. Prepare to die.”
 

And Westley faces the prince… without being able to move a single muscle. But he doesn’t know and as the coward he is, he surrenders and everybody manage to escape the castle.

Personal Review: I cannot just simply comment or review this book, because the movie, which I watched when I was a kid, is one of my big movies. The things that marked my life. And nowadays memes from this story are everywhere, it’s “inconceivable”.

To put you in situation, I watched the movie many years ago, but know about the book just one year back, and was something quite random, somebody just took a fancy book to the lab… I look at it bored, just being curious… and there it was! The princess bride book! I liked so much the movie that I brought the book straight away… and didn’t read it. What if it is not good? What if the story is different?

I waited for months with the book always next to my bed… and when I flew to Italy I rode it. I was on the plane and It was amazing. The flight was so short that I stay awake on the hotel trying to finish it before the next day (which was my first day on a short stay at INRIM).

I admit that the story is a fantasy/adventure, so ideal that most of the people will say it’s for kids. Is it for kids? I mean, maybe it’s not a story to be taken as a love tragedy but as an epic battle. If you consider it this way…

Buttercup and Westley become in love just after knowing each other for a while, and not because of their appearance or rich families, just because they care about each other.

Iñigo studied for 20 years to avenge his father. In the book the story is much more rich with many details. He travelled the world learning from every master, always wishing to fulfil his task to allow his father rest in peace.

Fezzik was a good fellow, he was just big, too big. In the book he travelled the world as a professional wrestler, and when nobody wanted to fight with him, he started fighting groups (that’s where the movie quote “i specialized on groups” come from. And eventually he was completely alone in the world, with nobody who wanted to be near him. That’s a love story again.

When Westley leaves to try to offer something better to Buttercup, that is love again. He could have stay and lived on Buttercup’s parent’s, but he decided to go away for her, to be able to offer something to make her happy.

When Roberts is about to kill Westley and he ask “please I need to live”, that is a tremendous epic moment. His life doesn’t mean being surrounded by pleasures, treasures, women… no, his life is for Buttercup, that’s why he asks to live.

The rescue of Buttercup it’s another proof of love. Don’t you think that Westley, being the Dread pirate Roberts and with fame and fortune, knowing about Buttercup’s wedding could have left her marry the prince? Why he goes back? Because he still loves her and despite everything looks lost, he risks his life trying to see if love is lost or there is a chance. He never give back.

And the sacrifice of Buttercup, accepting the prince to try to protect Westley’s live, that’s again, her life is not her, but for Westley.

The most impressive moment is when they torture Westley. Now they proof again that love is what really matter to him. They can crush his bones and his flesh, but know Buttercup loves him gives him enough strength to overcome it.

And finally, when Westley comes back to live to fight the final battle, with all the odds against him… that is epic. I mean, it’s not just restoring life, it’s fighting for love, coming back to live because his loved is in danger and needs him.

I think the movie can be more commercial, and also the book, but the ingredients for an epic story are there, and in some ways is better not to change it, because it’s perfect as it is. Maybe tragedy is not shown as in other stories, but is there, and love as the most powerful, irresistible, force is also there.

I need to say also that this movie is one special case of becoming better with the ages. Because it seems it is always gaining more fans. It’s more popular now than when it was released, and the memes from it are making it a part of our culture.

I think I cannot say anything more about this story. Just enjoy it, and if you don’t like it, be it.

Just one thing, if you didn’t watch the swords video, this is at the end of it:

pEDUOFG

And that is all.

.

.

.

.

.

.

.

.

.

.

What?

.

.

.

.

.

.

.

Oh, c’mon, ok, here it is, Lego Princess Bride (kid, grandpa, duel, fight, intellect battle… and kiss)

6822223592_65e7f5c2c0_c.

.

.

.

.

.

.

.

.

.

.

.

.

.

Ok, here is the real ending, enjoy ;)

photosynth new features (tested on Dresden)

Recently photosynth has introduce new features to it’s web, like interactive travels, 3D images of places, walls… all of them wit the usual panorama. As you know, I like photosynth and have a nice set of pictures there, so I have to test it immediately. In order to test it, and using that I’m on Dresden this week and there is lots of things to see, i have been playing around a little bit. Tell me if you like it. Click on the image to see the Statue of Saxon King John in Dresden.

dresden

2 years old

According to Tumblr the Brick in the Sky just turned 2 years old… well, that’s not completely truth, we have about…

2 years, 6 months, 20 days and a few hours

the error occurs because it was 2 years ago when I linked this blog with Tumbler, but it doesn’t matter, we still want to celebrate.

And we are going to do it remembering some of our most iconic posts and important numbers, because… we have more than 200 followers, being the 3 oldest ones

Stories by Williams

classic sci-fi books, reviews, and the best of from a dedicated fan and author!

PRINT AND PATTERN

SIMPLICITY IS THE ULTIMATE SOPHISTICATION

leeshausoftherisingsun

Being the adventures of a young man whose principal interests are film, ultra-violence and Music.

Thanks buddies!
Do you remember our first post?

Lego pick of the week (LPoW) 001

092111_1516_legopickoft12

It has been a long time since that, in this 2 years and a half we have publish…

452 posts

 Being:

174 Art

104 Lego Pick of the Week (LPoW)

106 Crazy Experiments

91 Physics

72 book reviews

44 Star wars

41 Tutorials

23 Neko Time! =^_^=

20 Animated Short Film of the Week (ASFoW)

17 Star Trek

11 Origami

2 Oommf

and

55 drafts that are work in progress

(Note: Some might belong to two or more categories at the same time)

With a total of 14,700 views and more than 1000 visits per month since the last 6 months… we reach…

1500 visits per month last month!

Untitled

Thanks to all of you!

None of this can’t be done without your support.

And to thank you all, you want to know which are the most viewed posts? Here they are the most viewed posts of all time (views after being in the home page):

5th with 462 views

Standard Tessellation Language and Matlab… and STW

destroyer2

4th with 575 views

Pepakura Pepepepepepe Pepakura!!!

pepa

3th with 833 views

OOmmf

domain

2th with 913 views

L-Systems and Penrose P3 in Inkscape

inkpenro

and

.

.

.

.

.

.

.

.

.

.

.

.

What do you think it is?

.

.

.

.

.

.

.

.

.

1st with 1244 views

Jo Nakashima. Origami Tutorials.

7786760060_4dbe2100fc_z

 

Thanks to all of you. Let’s hope this little project keeps alive for at least another 2 and a half years.

Lego on your browser!

I built a house on west London. Don’t believe me? Here it is.

mapo

And this is the model.

lego

And… what is this?

This is Lego and Google showing of their new project based on the new WebGL technology. Did you remeber this old post about Google Experiments? This is a new experiment (one that is going to become viral, I’m sure).

You can build and place your creation somewhere all over the world… or explore other people ones. I love it.

An Update. Some publicity for the blog. Share if you like it!

OOmmf 2

One of the most visited post of all times in this blog is the OOmmf post with a quick introduction into OOmmf and the comparison between simulation and a real magnetic material images. That’s the reason for this post. I think people will like it.

ommf

Here we are going to create a simulation, store the data and create nice animations with it. And on top of that, we are going to learn how to export the simulation data into Matlab and Python.

Let’s start selecting the structure we want to simulate and the parameters.

The mask we are going to use is this one (click on it to download, and remember to put it into your ….\oommf12a5rc_20120928_85_x64\oommf-1.2a5\app\mmpe\examples folder).

nucleation_padAnd the material is going to be Permalloy.

This structure is interesting because it’s a typical structure to study Domain Wall (DW) nucleation and propagation. When we ramp the magnetic field from left to right we are going to see how a DW forms on the big pad and moves towards the needle-like end on the right.

So. Let’s go with the geometrical parameters for this structure. We are going to select them in a way that the nanowire connecting the pad with the sharp end is going to be around 150 nanometers wide. So, according to the image size, the mask is going to be 700 nanometers height and 3800 nanometers wide. The cell size is going to be 5 nanometers (for Permalloy the exchange length is 5 nanometers, so the cell must be that size or even smaller, and many published papers use 5 nanometer in the simulations).

nucleation_material

For the material we are going to select Permalloy as it comes in the program with standard parameters.

material

And now let’s specify the external magnetic field during the simulation. We are going to create 3 steps where the field is changing in this way:

from 0 to -200mT in x axes

from -200 to 200 in x axes

from 200 to -200 in x axes

field

The next thing is now to select the initial magnetization. You can use a random magnetization. In our case we are going to use a previous saved file which magnetization divergence looks like this:

pre_charge

Just load the data file into the initial magnetization path.

initial_mag

Later we will explain how to save data, because this is a very useful trick to resume simulations or start from a particular state. Now the final step to prepare the problem is to select the output and change it from binary 4 to text %g. In this way the magnetization in each point will be stored as a text number. In this way is going to be quite easy to load the data into Matlab to do more analysis.

problem_output

We are ready now to do the simulations, the next thing is to open a display to show the magnetization on the screen and 2 archives to save data. Remember to keep all of them on the screen, including the problem editor. Sometimes if you close the problem editor the values are reset.

menus

Ok, so click Solve2D, load the problem and select to visualize the magnetization on the display every 100 iterations. For the first archive select magnetization and store also every 100 iterations. For the second archive store total field every 100 iterations. Ideally we only want to save every control point, that is, when a stable magnetization is reached for every magnetic field step. But the Domain Wall propagation along the wire is a dynamic process, and we will miss it if we store on control points (I know, I did it before). And why 100? Why not every one iteration? Because I did this simulation before and it is going to take about 406934 iterations, so even saving every 100 means more than 4000 data files.

solve2dClick Run and wait…

This is going to generate screen outputs every 100 iteration steps, and save the data on every control point (each time equilibrium is reached for a set field).

If you want to display the data while running the simulation as we do here, this is the configuration for the display. A little trick is to change the data scale on the display and reduce it. That will increase the contrast on the image.

config.

.

.

.

It took me a few days finishing the simulation (not running during nigths and not at full speed (that is something I need to investigate why)), but finally you will have 1004 files generated. Half of them will look like test.field0xxx-passxxxxxx.ohf that ones are for the total field on each point of the simulation, and half of them will look like test.field0xxx-passxxxxxx.omf that ones are for the magnetization at each point.

ok. Can we actually transform these files into something we can “see” or analyse in some way? Yes, we can.

We have:

About 500 files with magnetization (*.omf).

About 500 files with total field (*.ohf).

Our options

Turn Data into Images and compose an animation.

Import data into another program and do an animation there.

Turn Data into Images and compose an animation.

Let’s try the easy route. Turn data into Images and compose an animation. To do that, on the display window File>Show Console and we start to figth with the OOmmf console. I say this because some commands will work, others not… and everything will sound weird to people like me, used to write commands in other way. Anyway. After some try and error I found that this command will turn all the .omf files in the main OOmmf folder into jpg images.

tclsh oommf.tcl avf2ppm *.omf -config magnetic.txt -opatsub .jpg
 -filter "tclsh oommf.tcl any2ppm -format jpeg"

You just type it in and it will turn all the magnetization files into jpeg images. But before doing it, remember to create a options file named (in this case) magnetic.txt It will be a text file with options for the conversion. This is how it looks like in my case.

array set plot_config {
    colormaps  { Red-Black-Blue Blue-White-Red Teal-White-Red \
            Black-Gray-White White-Green-Black Red-Green-Blue-Red }
    arrow,status       0
    arrow,colormap     Black-Gray-White
    arrow,colorcount   0
    arrow,quantity     z
    arrow,autosample   1
    arrow,subsample    10
    arrow,size         1
    arrow,antialias    1
    pixel,status       1
    pixel,colormap     Black-Gray-White
    pixel,colorcount   60
    pixel,quantity     div
    pixel,autosample   0
    pixel,subsample    1
    pixel,size         1
    misc,background    #FFFFFF
    misc,drawboundary  1
    misc,margin        10
    misc,width         1280
    misc,height        960
    misc,crop          1
    misc,zoom          0
    misc,rotation      0
    misc,datascale     13200
}

The whole explanation for these commands is in the Nist webpage here.

You can do the same with the total field data, but is quite boring. Just change omf for ohf in the comand and select arrows in the configuration file.

Once the magnetization images are created, we can remove the first 100 (remember that those correspond to the first ramping up of the field from zero to high x negative values) and the remaining 400 images can be used to create a loop in a video, because the last one and the first one will have the same magnetization and also the same external field.

To create an animated GIF. This time we are going to use GIMP.

indexJust go to the webpage, download and install, it’s free and I will tell you how to use it for this.

Open the program. And File>Open as layers and select all the images you have just created (first order them by date). They will appear on the layer menu and the first one will be show on the display.

Untitled

And now is as simple as File>Export and select GIF on the type of file… remember to add .gif after the file name. And select export as animation.

Untitled2

And this is how it looks like (with low quality).

nucleation_GIMP3

NICE!!!! It looks amazing. Notice the two kinds of Domain Walls, one when the magnetic field is saturating to the left and another one when it is saturating to the right. Also, on the pad, where there is some roughness on the surface, you can also see the Domain Wall moving like jumping, the Barkhausen effect (Domain Wall encountering defects on its way and getting pinned to them)

Now let’s try the other option.

Import data into another program and do an animation there.

To do that, I have selected Matlab and I wrote a code to import the data into it. Can be found here at the Matlab File Exchange.

Basically, what the code does is read the data files line by line, extract the data like size of the simulation, number of points used, magnetic field… And then, because we select the output to be text %g it just reads the coordinate of each vector on the vector field. To have an idea this is how a data file looks like (You can open *.omf files with Notepad and this will show).

# OOMMF: rectangular mesh v1.0
# Segment count: 1
# Begin: Segment
# Begin: Header
# Title: C:/Users/Hector/Downloads/oommf12a5rc_20120928_85_x64/oommf-1.2a5/test.field0000-pass03369.omf
# Desc: Field Index: 0 
# Desc: Applied field (T): 0 0 0 
# Desc: Iteration: 3369 
# Desc: Time (s): 1.8747579070869034e-9 
# Desc: |m x h|: 0.092583929421348854 
# Desc: User Comment: 
# meshtype: rectangular
# meshunit: m
# xbase: 2.5e-009
# ybase: 2.5e-009
# zbase: 1e-008
# xstepsize: 5e-009
# ystepsize: 5e-009
# zstepsize: 2e-008
# xnodes: 400
# ynodes: 100
# znodes: 1
# xmin: 0
# ymin: 0
# zmin: 0
# xmax: 2e-006
# ymax: 5e-007
# zmax: 2e-008
# valueunit: A/m
# valuemultiplier: 800000
# ValueRangeMinMag: 1e-8
# ValueRangeMaxMag: 1.0
# End: Header
# Begin: Data Text
-0 0 0
0 0 -0
-0 0 -0
-0.263872 -0.417373 0.000337065
-0.238721 -0.433818 0.000330522
-0.211667 -0.449099 0.000320794
-0.182926 -0.462911 0.000308174
-0.152747 -0.474998 0.000293057
-0.121395 -0.485153 0.000275874
# End: Data Text
# End: Segment

I cut down part of the data to make it fit. Notice the vectors because they have 3 coordinates, but notice they are not in the place they occupy in the simulation. To arrange them in the correct order you need to extract the data of number of x y and z nodes.

If you want to download and try my code, do it. Once you have the data on Matlab the limit is your imagination. This is how some of it will look alike.

Captura de pantalla 2013-11-06 23.15.38

And this is all for now. Hope you like it. Next time more.

Neko Time!!! =^_^= matthen

Last week I spend some days in Cambridge performing some experiments at the university,l and as always happens when I go to Cambridge, I learn something new.

This time I came across Matt Henderson blog.

title

Matt has a mathematics degree by Cambridge University, and he is now working on his PhD on statistical dialogue systems.

He is an unstoppable explorer. His blog is full of experiments and nice mathematical simulations. And here I want to show you which are the ones I like the most. Who knows, maybe a collaboration between us could be possible in the future.

So, here they are.

Aggregation.

tumblr_mntt93OyoA1qfg7o3o1_r1_250

Basically, if you have particles moving randomly and they are able to become added to a seed, then these random patterns appear. They are close related to chemical reactions and electrical transport. Nice post, with code, and a link to.. Agregation images by Andy Lomas.

Gingerbreadman.

tumblr_mlgpp4cgNH1qfg7o3o1_400

Gingerbreadman is a chaotic map. Basically, you select random points in the plane and using very simple equations, you transform the points into new ones. If you repeat it enough times, a figure appears that looks like a Gingerbreadman. And I like this one because I also explore it myself. Remember this?

Iterated Function Systems.

tumblr_lsah2gDte41qfg7o3o1_400

Iterated function systems is a technique to build fractals using transformations of points. It’s similar to the Gingerbreadman map, but with a set of equations that alternate randomly. And I also explore it! Remember the 100 posts post?

untitled2

Double pendulum.

tumblr_loshhy8REd1qfg7o3o1_400

This was the post that bring me to the blog. The double pendulum is an example of a quite simple chaotic system, it’s only two pendulums linked. In the image on top we can see 2 double pendulums, what the animation want to show is that quite similar initial conditions can evolve into very different evolutions. (I’m working in a nice post about this, but I’m not telling anything more now).

Functors.

functors

This is an applet to play with iterated functions systems. This one uses the geometrical approach for defining the functions used for performing the iteration. I like it, is quite good. Unfortunately, it’s difficult to repeat successfully patterns.

Create GIF animations with Mathematica.


I don’t like Mathematica, I prefer Matlab or Python, but… who knows, this could be useful.

Animated Optical Illusions.

tumblr_lntb48cP5E1qfg7o3o1_400

I saw this effect long ago in a book. I like it. I never had enough time to make anything. But here you can see how it works.

Designing Galleries.

tumblr_lme082yXiB1qfg7o3o1_400

In this post what he wants to show is the importance of designing of buildings. Basically, a good design can help to build a museum where you can visit exactly once each room without crossing with other visitors. Or… if it is a mall, how to design it to make people walk several times into the same point (increasing the showing of that particular shop).

Soap film holes.

The film doesn’t belongs to the blog, but is so amazing…

Shepard scale.

I like this one, is my first sound illusion. Basically, you feel like the scale is getting higher, but it is not.

tumblr_lk3qz6RoRc1qfg7o3o1_400
A Tautochrone (or Brachistochrone if you focus on other property) is a curve where no matter you put a ball on it, it always takes the same time to get to the botom point. I saw many times the Brachistochrone and never realize that it also has this property. I can think of quite funny experiments now for it.

Quine.

f[x_] := Print[StringJoin[x, FromCharacterCode[{91, 34}],x,FromCharacterCode[{34, 93}]]];
f[“f[x_]:=Print[StringJoin[x,FromCharacterCode[{91, 34}],x,FromCharacterCode[{34, 93}]]];f”]

A quine is a piece of code which is able to print itself. I heard about it before, but it’s the first time I saw one for Mathematica.

And thats all. If you want more, visit his blog. Hope you like it!