Showing posts with label ImageMagick. Show all posts
Showing posts with label ImageMagick. Show all posts

More advances on weather


cd /home/motey/bin
python webkit2png.py http://www.nws.noaa.gov/>page1.png
echo -ne "Page 1"
convert -crop 416x242+261+258 page1.png map1.png
python webkit2png.py http://www.weather.gov/sat_tab.php?image=ir>page2.png
echo -ne "Page 2"
convert -crop 517x378+140+299 page2.png map2.png
python webkit2png.py http://www.weather.gov/forecasts/graphical/sectors/>page3.png
echo -ne "Page 3"
convert -crop 517x375+147+275 page3.png map3.png
python webkit2png.py http://www.weather.gov/forecasts/wfo/supplementalpages/view_image.php?image=../images/dmx/MaxT1_dmx.png>page4.png
echo -ne "Page 4"
convert -crop 427x505+199+140 page4.png map4.png
python webkit2png.py "http://forecast.weather.gov/MapClick.php?lat=41.48389104267175&lon=-93.372802734375&site=dmx&smap=1&marine=0&unit=0&lg=en&FcstType=graphical">page5.png
echo "Page 5"
convert -crop 810x1048+70+354 page5.png map5.png
display map1.png & display map2.png & display map3.png & display map4.png & display map5.png
ps

Ultimately I will merge the data to textures and incorporate them as a room in the caves of reason. Above is the latest script and I like the graphing they do as it seems to be done with gnuplot, but since it is the gubmint it is more likely they are paying Microsoft ( with my money ) for something that is available free. Mickey Microsoft knows how to make money for nothing, that is for sure. The sad thing is that the government we own is in cahoots to help them rob the people they are "supposed" to serve.

Just the fluff ma'am


python webkit2png.py http://www.somepage/>page.png convert -crop 416x242+261+258 page.png cropped.png

This is an example of one shell script used to get the data of interest and leave the rest. The code is created in a script in the execute path of shell and then the normal language interface translates a statement into the action in whatever language or script is required. In this case it could be "show me the US precipitation map" or "show me the US temperature map" and I have published a shell script that does this and it is actually easier to make a hash and data base, but that is a long program and should be something that any programmer can do in a matter of minutes.

I was trying out a python script called webkit2png.py and combining that with all my other programs and plasmoids and such. It is very odd, but I can change my entire view of the web by making my interface more and more intelligent all the time. I browse the web in a rather obtuse way. By using many scripts and pre processing of data, I eat all the worms and spit out the germs.

To make that more clear, spam is considered net trash and just thrown away. It could be considered a resource. A lot of effort goes into creating and shoveling spam into NULL space. If the stream can be manipulated , it becomes a tool and though that process distorts the purpose of the spam to different goals, they are offering it for free and why shouldn't I get a computational gain from their effort. It would seem that if the effectiveness of the spam was reduced they would produce more to get the same effect and I could then collect more. Any state change that has memory can be made computational. By influencing the manifold space of the envelope, I am simply programming in a new language. The spam must be cast and thus is a process and any process can be programmed from external events. A honey pot is a kind of spam trap, but they are not reprogramming the stream to their benefit. They are taking a very dull and time consuming approach. It fails to take into account the underlying process. Removing or hardening an interface does not stop criminal motive, they have an infinite play field to act upon. Locking one of an infinite set of doors to your house simply means they will enter through the next.

So let them in an easy door and run them on a treadmill trying to get back out, so they generate electricity. Will you stop trying to leave, if I let you out?

Might work, I will consider it. Infinity plus one is always fun.

ImageMagick png transparency

I posted earlier about creating images using different fonts and text HERE and I wanted to do some transparency manipulation and I know I can do that when I load the png, but I didn't want to reinvent the inter-space Einstein-Rosen-Podolsky bridge navigator, oops, I mean wheel. So I looked to ImageMagick, which I think can do about anything at command line, if you know what you want. So I modified the code as follows:

 filename[14] = (char)((int)('p'));
 filename[15] = (char)((int)('n'));
 filename[16] = (char)((int)('g'));
 filename[11] = (char)((int)('A')+ii);
 filename[12] = (char)((int)('1')+jj);
if ( ImageCheck(filename) == 0 ) 
{
 filename[14] = (char)((int)('b'));
 filename[15] = (char)((int)('m'));
 filename[16] = (char)((int)('p'));
LoadGLTexture(filename, texture, textureNum);
}
else
{
loadTexture(filename, texture, textureNum, 256, 256);
}

In the code I try and open the png first and if it exists ( ImageCheck() returns 1 if it exists and 0 otherwise ) , I apply the libpng and otherwise fall back to loading the crappy bmp.

I then applied the script below. Note that I had to set "depth 8" as it defaults to 16, which seems odd, but not for somebody who wants every bit of color they can scrape together. I use the ridiculous value of "-fuzz 75%" around the transparency center of "-transparent #ffffff" to get rid of all the jaggy edges in this case. Your mileage may vary and different values and colors would be for different purposes. The script finds bmps "for i in *.bmp" takes the names and makes a copy of the name and switches bmp to png in the copy using sed, " x=`echo "$i"|sed s/.bmp/.png/` " and then uses the original name and the new name with png to create the new texture.

cd res for i in *.bmp do x=`echo "$i"|sed s/.bmp/.png/` convert -fuzz 75% -transparent "#ffffff" -depth 8 -resize 256x256 "$i" "$x" done cd ..

I am planning to have 9 rows and columns as the default puzzle size and the 7th row is images, the 8th is Egyptian Hieroglyphs and the 9th is a surprise Alien dictionary lookup or perhaps it will be common poly-peptides from RasMol :). It will keep me interested as it evolves to a DNA and protein microcode generator. It takes me longer to blog about this , than it does to run the script. I suppose I could have Gimped all the images, but, come on, you have to know how lazy I am. Once I have all the scripts, I won't pack images with the source, just add a line to the make file to create the images the first time.

ADDED: in the sed method I substitute by finding ".bmp", and in practice that may work, but be warned it is just because of some limited possibilities. What would be proper and safe is "[.]bmp" which isolates the "." as a real character and not a wild card match to anything. I just thought I would mention that, as I looked back on posts and saw that I had done something expedient, which was poor form in general.

PNG inclusions

I really dislike BMP format and I don't know why really. It seems outdated, limited and weak in design. The dice image is from an article at Wikipedia about png formats. As you can see it is transparent where it should be and now I am thinking I will spend some more time and make some better PNG textures for the game with InkScape, Blender and the Gimp. I like the looks of it and it is fun to play with. I suppose I will have to make some help and support it if people actually want to play it.

I think I said I would do some png implementation before I left the game to somebody else to play with. And so here it is. I used libpng and it is reasonably simple to apply. I found an example that used C++ and I am not enthused at all about "new" and "delete[]". I prefer to know what memory I have allocated and keep it in a list so I can debug if I want. I noticed while going through some tutorials on the web that many people have error returns with malloc(x) and I think that you are pretty well done for if you can't allocate memory for process. That is just my opinion. Why warn somebody that the machine is useless?

I also noticed that there is a lot of marginal code wandering about. I know that Ms sells its marginal code as shiny new bits, but other people generate some iffy stuff at times too. One of the issues is "code rot". If the code is not updated for changes in libraries and machines it decays. I found many places where people forgot to consider endedness and integer size. I wonder what is going to happen when we have 128 bit machines as a standard? I use a 64 bit machine and I quite often encounter bit rot in applications. It seems that debian and Linux are keeping up to date, quite well. I would guess that Linux would be implement 128 bit years before Ms, because they have the test framework, and design methodology to certify the function of the code. I suppose that is why Linux shows up so many places, so quickly, it is a designed to be inherently portable.

My brain is suffering from code rot too and I need to get away from programming for a while. I guess we will see how that goes.

/* set the individual row_pointers to point at the correct offsets of image_data*/ for (i = 0; i < height; ++i) {row_pointers[height - 1 - i] = (void *)(image1->data + i * rowbytes);} /* read the png into image_data through row_pointers */ png_read_image(png_ptr, row_pointers); /* Now generate the OpenGL texture object*/ glBindTexture(GL_TEXTURE_2D,texture[textureNum]); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); glTexImage2D(GL_TEXTURE_2D,0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, (GLvoid*) image1->data); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

I think there is something potentially wrong going on here and it is one of those things that creeps up from behind and bites later. I have a question as to how libpng determines the size of pointers? It could decide from the system itself and it must, so I guess it is okay, as it didn't go wandering off into NULL space. :)

Strange universe with emergence

In all the universe, the flow of information moves from every particle in the universe to every other particle. It means that in any given second, a minimum of, 10^150 bits of information moves through our bodies. It isn't conjecture or theory, it is just the consequence of the existence of gravity and electrical fields themselves. The information is in the form of "I am here." and the response is "I see." and  "I am here.". The universe is quite a bit more complex than most people are willing to consider. Even in the span of a simple change in some software that operates vastly higher than the level of quantum uncertainty, it is easy to miss secondary, tertiary, and more effects that can proceed. Factorial combinations of changes can easily overwhelm the ability of the mind to cope with change.

It is not unreasonable to assume that intelligence is the real power in the universe. Force, destruction, torture, and containment are useless in a system that is as complex and changing as the vast extent of space. I see patterns in the structure of the universe and it is fairly obvious that what we consider so great and advanced is less than a blink in a starless universe. The knowledge that flows from everything in the universe and is registered by every other thing in the universe cannot be contained by any method presently known. I seriously doubt that it can ever be contained, due to the fact that the universe exists in a state of symmetry which stems from the fact that for every action, there is a reaction. This parity and conservation is inherent in the universe and like momentum, cannot be destroyed.

These kind of complexities combine in factorial methods and I am wondering at what point a system that is being, becomes emergent above the limit of resolution.

I couldn't add an image to the last post due to some complication, local or remote, and so I added it here. It shows the changes I am making to the icons for the puzzle game. I am using gimp, convert, ImageMagic, Inkscape, and Blender to produce some new images that I hope will make the game more interesting and playable. You can see that the textures are quite a bit more elegant and make the game look more professional. I am just doing it for fun, it is fun to learn and apply what I learn, and so the purpose is achieved. It is a strange universe and I don't need a billion dollar telescope to see that α-Centauri says "I am here." and reply "I see." and "I am here.".

Articulated Imagination (AI)

I was looking back at old posts and this image no longer shows up. I wonder why that is, but I have more important things to wonder about so I am going to ignore this riddle. And now it shows up, oh well, I give.

I am working on implementing imagination for the einstein game that I have been fiddling with for some time. In terms of complexity it is e17 and Rubik's is e13. I wanted to see if there were other possible solutions with the hints given. I wanted to know if a set of hints produced a unique answer matrix. I also wanted to make the puzzle 3D and display an associative matrix of how the parts interacted. In an object approach I am removing all the SDL video display and changing it to OpenGL using scaled and related elements. I also intend to implement a second window for hints so that the puzzle is displayed separately from the menu and hints or high scores or help. Application of hints in an Artificial Imagination that displays as an object in OpenGl and the parts of the asscoiation are elements of OpenGl characteristics like rotation, x, y, scaling and brightness (highlight).

I have been using convert ( the Linux image utility ) along with a shell script , grep and sed to make the images conform to OpenGl square images that are factors of 2.

convert -list font | grep Can
./3Dtext -t "こんにちは\n Mohr" -f CanGoods.ttf -p 72 -d northwest ana.png

I was wondering if convert could be made to generate unicode characters and I haven't achieved that yet and I am wondering how this operates. It is a bit confusing as it involves the character sets and how convert and shell handle strings.

Complex automatic demo video tutorials

This is a link to the image at ImageMagick scripts using the "shapemorph" script to generate an animated .gif

A very interesting site that I happened into is this script page for ImageMagick scripts . And here is a link for ImageMagick.The Linux utility "convert" is available through the repository.

My goal to finish tonight is automated scripting of the entire system using "Xtst" extensions which allow me to simulate keys and mouse movements. In addition I am using "espeak" which speaks text as phonemes. I am also using utilities inside the program to generate frames, capture them from the frame buffer, and create images that will be collected into a video using "convert".

The result is a complete tutorial that can operate "blender", "gimp", run scripts, operate my program and finally create itself as an ogg, mpeg or avi video file. In the process I can mix the .wav files from "espeak".

I am not sure where this leads, however I think it reaches the point where the program designs itself and then demonstrates how the results are achieved. These same effects can be exemplified with matrix computations and the LaTex equations can automatically be generated to display as part of the demo video along with internally generated openGL methods to show n-space transforms, and various graphs and set effects to illustrate the physical generation of matter structure.

Contributors

Automated Intelligence

Automated Intelligence
Auftrag der unendlichen LOL katzen