Saturday, January 19, 2008

Top 10 Javascripts for Image Manipulation

Reflex
Reflex.js

This javascript enables you to add a cover flow effect to any image on your web page. You can add reflection, tilt angles and also borders to your images. The results look like this:-

Reflex Image

Curl
Curl.js

This is an unobtrusive javascript to add page curl effect to your images and works on all the major web browsers. It can also produce the curl on mouseover where it animates the effect. Here is what it can accomplish:-

Curl Image

Edge

Edge.js

This javascript can help you in adding nifty edges to your images. You can even mask a second transparent image to generate some nice looking eye candy. I was able to make the script do this:-

Edge Image

Corner
Corner.js

This javascript lets you add effects to your image corners like rounded corners, shadow (both inner and outer), shading etc. This is what can be done using this javascript :-

Corner Image

Slided
Slided.js

You can add slide frames to your images by using this javascript in your web pages. I am sure it can be useful to some people. This is what I came up with:-

Slided Image

Glossy
Glossy.js

Add a glossy effect to your images to make them stand out. This javascript also allows to add corners, shading and shadow. Here is my result:-

Glossy Image

Filmed
Filmed.js

This javascript allows you to add film strips around your images. You can also add shadow and shine to your film strip edges. This is what it looks like:-

Filmed Image

Loupe
Loupe.js

Did you ever want to add a lens to your page which will let you zoom into the images. This script will let you do that and much more using two versions of your image. Here is a preview:-

Loupe Image

Instant
Instant.js

This javascript lets you add an instant picture effect to your images. You can add border, tilt and shadow to give your images that photo effect which you always wanted. Here is a sample:-

Instant Image

Bevel
Bevel.js

This javascript simulates a whole bunch of effects! It allows you to add bevels with glow, shading and shine to your images. Here is the javascript in action:-

Bevel Image

Thursday, January 17, 2008

10 Reasons Why the Command Line is More User-Friendly than the Desktop

I aim all of these not just at Linux, BSD, and Unix-alikes, but at every computer system ever. Nor do I say all of this as a power-using geek, but to apply it to every computer user everywhere.

1. Keying is faster than mousing.
You might argue this point, and if you do, I'd just point out "Why are there keyboard shortcuts on most menu entries in a GUI?" And why are they called "shortcuts"? Because using a mouse to do something is the long way to do it, each and every time.

2. It's easier to both give and get help.
Nearly every Debian system has synaptic, and I'll bet most people use it. Yet even amongst synaptic users, they'll still answer questions with an "apt-get" statement. It doesn't matter if you use apt-get or synaptic; it's still more efficient to use the command expression behind the GUI action to answer questions online. You can interpret the answer into the GUI tool of your choice.
Ever seen somebody answer a question that has no command-line answer? "Go here, double-click that, click this pull-down, click the arrow, click 'yes', click 'edit', double-click this, that, highlight this..." And this applies on Windows as well; even there it's easier to define an action in DOS commands than it is to describe mouse actions.

This is why our mail is addressed to our house, instead of having instructions to the postman: "Go down main street, turn left, go to spruce street, turn right, go to the eighth building on the right, go up the stairs...".

3. Repetitive stress injury comes from the mouse, not the keyboard.
Do something that uses the keyboard for awhile, then do something that uses the mouse for awhile. How do your hands feel? I especially notice that when I play a game like Diablo or Starcraft, my right hand is cramping terribly after a few hours. But I can play Nethack all day and not feel any pain at all. It stands to reason that if you filter the work of both hands and ten fingers through one wrist and three fingers, you'll have more repetitive motion stress.

4. Commands are standard where GUIs are not.
How do I find a word in a document using a GUI? Do I click "edit - find and replace"? Do I click "view - find"? Do I click "find - search page"? Does the dialog pop up, or does it pop in from the side, or does it show up in a bar at the bottom? Do I have to click close afterwards, or will it close itself? Is the 'find' dialog separate from the 'replace' dialog, or are they combined? Does the dialog on the program understand a regular expression? It all depends on which program you're using - and often which version. And - again, no matter what platform - there's a dozen possible GUI tools to do the same thing with complete feature overlap. Which one do you have available?

How do I find a word in a document using a command line? Grep! I learned grep once in 1998 and haven't had to open the man page since. I'll still be able to use grep 20 years from now. Every Unix-based system has it, even Macs and Windows has it available, and it's always the same from platform to platform.

5. Commands are more powerful.
I don't care how well-designed the GUI is, there's always something you need to do that they forgot to put in a menu item for. But commands can be adapted to many purposes. Especially when you have to do the same action many times. Go ahead, resize a bunch of images to thumbnails in your GUI tool; you'll be working all day while I can type out an Image Magick incantation in one minute and go take a nap while it does it all automatically.

How about editing a document where you need to change all instances of something, except where a special case is true? Unzip a stack of downloaded files, rename them all to a specific scheme, and move them all to different directories? The GUI is good only for limited-use cases and specific actions, but it only takes you that far.

6. You can automate commands.
Really, you only have to learn each command once. Then, no matter how complex, you can save it in a shell script, run it from a menu item, execute it from one key-press, or even give it to cron to perform automatically. There is no computing job on Heaven or Earth that cannot be reduced to a single motion, given a proper scripting environment.

7. Commands are easier to remember than clicks.
Face it, our brains handle words better than they handle spacial sequences of motions. How many times have you tried to show somebody else how to perform a mouse task, only to realize that without sitting in front of the machine doing it yourself, you can't remember how it goes? Learn a command and it's yours for life.

8. GUIs are always changing.
Everybody wants to re-invent the widget set, patent the scroll wheel, re-think the dialog, put their own stamp on the GUI environment. Bring up GUI design, and there's a flame war all over the place about simple things like where a menu should go and whether to use a spin-box or a combo-box. Commands have been performed the same way since the keyboard was invented, end of story.

9. Commands are more error-safe.
All I ever hear is how you can accidentally type "rm -rf ./*" or "del *.*" in the wrong place and wipe out your file system, but look at practical experience. How many times have any of us actually done that? Now, how many times have you clicked 'yes' or 'allow' to the wrong dialog, clicked the wrong button and closed a window when you meant to minimize it, opened the wrong file in a dialog, selected the wrong action in a menu, had to make three tries to drag a selection box around a group of files, dragged and dropped a folder to the wrong place... the list goes on and on. Mousing takes intense co-ordination and concentration to hit a target a few pixels wide, and in the event of a mistake the wrong action is always performed instantly.

A command line does not fire off until you hit enter. So you can read it after you've typed it to be sure it's what you want to do. You can edit it before you execute it. And your brain is actually engaged in the task, instead of focusing on performing millimeter-precise actions with a few muscles in one hand.

10. You have to type to use a computer anyway.
You can get quite far on a computer without a mouse, as long as the programs are set up to accept keystroke commands. But try this: unplug the keyboard and hide it. Now, how far did you get using the computer? How can you IM, email, edit, comment, name files? No matter how much you love your GUI interface, you still spend the bulk of your time using a keyboard.