Nothing To Lose

If you don’t have it, how can you lose it!
Subscribe

Rubber Stamp Effect Using GIMP

August 13, 2009 By: Dexter Category: GIMP, Tutorial, Web Graphics

It has been a long time since I have posted a GIMP tutorial. So here is one more Which provide a Old rubber stamp effect in some very simple steps. So here we go.

Start with a blank canvas with white background. Write some text which you want to work as your ’stamp’ Use some font which is bold. Also select the text color which will act as your ink color.

Stamp Text

Stamp Text

Add a transparency layer above the text layer. Press Ctrl+L to invoke the layer dialog box, and add a layer using transparency option.
Draw a selection around the text you have just written.

rectangular selection on the transparent layer

rectangular selection on the transparent layer

Goto edit stroke selection — use a line thickness around 5 to 6 px.

stamp text with rectangular boundary

stamp text with rectangular boundary

Working on the same layer use the contiguous selection tool and click the rectangle to select that area only.

Selected outer border

Selected outer border

Goto Filter — noise — pick. In its dialog box increase the randomize to around 25% and repeat to around 40.

outer boundry has be distorted

Now switch to the layer the stamp text (press ctrl+l and then click on the text layer), select the text using contiguous selection (with shift selected) click on all the alphabets of you stamp text. Alternatively you can use select by color tool also.

text selected

repeat the pick filter as above, but decrease the randomize to 10% and repeat to only 20.
merge the layers if required.

finaly Old stamp

finally Old stamp

Rotate the image if required. I have kept a white background, if you want to use this image to be superimposed on other pages etc.. make sure you work on two transparency layers for text and box, and then remove the the white background layer.

Final old stamp.. Stamped

Final old stamp.. Stamped

Adding Vinay’s suggestion here, idea is to show that the stamp was pressed unevenly.
To do that same, take the final image, select Gradient Fill tool, set the options: Opacity to around 50%, Mode to color erase, Gradient Foreground to Transparent, Shape to Linear.
Then just click and drag the effect from one of the corners to other end (diagonally). This will cover the image with some white, giving some side of the ink to be faded. The effect looks like the ink is unevenly placed.

Stamp with uneven ink effect

Stamp with uneven ink effect

Setting date on Linux through the command line

April 27, 2009 By: Dexter Category: BASH, Linux, Linux Commands

It has always been said the setting the date through the command line is tough.  Well I found it very very simple.

By default date command displays the current system date and time.

To set the system date and time you can use the - -set option  with the date string.  Of course to do that you will need root access.

( - - set ( hyphen hyphen set) without spaces. some browsers combine the two hyphens)

ie.  date  - -set=’dd/mm/yyyy hh:mm:ss’

or

date  - -set=’27/04/2009 20:10:05′

that should set your date :)

[end]

Little Shiny Blue Button

April 09, 2009 By: Dexter Category: GIMP, Tutorial, Web Graphics

For last few day had been doing some designing. Had to make some buttons, so here is a tutorial for making a rounded cornered shiny button. And of course using GIMP Blue Button
  • Start with a canvas of comfortable size, say around 400×600. Even though our button is going to be small, its some times easier to work on a bigger canvas and then to crop to the actual size.
  • Now we will make a square selection, from the tool box, select rectangular selection tool. Set the following in its setting, Anti-aliasing, Rounded Corners: Radius 20 and Fixed size: 150×150px.
  • Now do a selection in center of the canvas, you should get a selection of 150×150px automatically with rounded corners. ( See Image 1 )

IMAGE 01

IMAGE 01

  • Select some dark blue (I used #0000E2) as you foreground color, the select the gradient fill tool. In the settings choose, Mode: Multiply, Gradient: foreground to background RGB. Offset: 20, Shape: linear, Check Dithering and Adaptive supersampling.
  • Now using the gradient fill tool click at the bottom of the selected square selection and drag till the upper part of the selection. You should see an image similar to IMAGE 2
  • Run the previous step again but this time start from a bit out side the upper part of the square selection and drag just almost till the blue start to appear and leave the mouse button. You should get some thing similar to IMAGE 3.
  • Now just cut and paste the selected area againl (^c and ^v). Press ^L to invoke the layer dialouge box, you will see a floating layer, click on the lower left icon/button (create new layer) of the dialog box, this will make the floating layer as a new seperate layer. Name this layer as (button-gradient)
  • Next select the button-gradient layer to work on from layer dialog box, press ^a and ^c, this will select that layer and paste a copy of the layer again.
  • Now select a even darker blue (#000080) as foreground color, go to edit menu and click on “Fill with foreground color”. Your image should be filled with the new blue color, Go to the layer dialog box and paste this as a new layer. Lets call it as the dark-border layer.
  • Next select your latest layer to work on, use “fuzzy select tool” to select all, it should select the outside of the box. Next from “select” menu choose, “shrink”. Use shrink value of 5px. You should get an image similar to IMAGE 4.
  • Hit the delete key, and you will be able to see the gradient layer!!!!.
    IMAGE 5
  • Now the button is ready. But it looks a bit flat. So lets add some shadow to the button. Select the dark-border layer to work upon. Go to filters, select “light and shadow” => “Drop Shadow”, set parameter to x and y offset to 0 (zero), and hit ok.
  • And your button is ready. Enjoy.
    IMAGE 6
  • For actual usage, its better to delete the background (White) layer, and then re-size the image to the Shadow layer.

IMAGE 2

IMAGE 2

IMAGE 3

IMAGE 3

IMAGE 4

IMAGE 4

IMAGE 5

IMAGE 5

IMAGE 6

IMAGE 6

There is a easy way to create more buttons of similar type in different colors, merging the layers of the image and then using the “Hue-Saturation” from “color” menu. Play around with it and enjoy.

Here are some sample buttons in different colors and gradients.

Blue Button

Blue Button

Red Button

Red Button

Green Button

Green Button

Brown Button

Brown Button

[end]

Counting occurences of a words/pattern using grep and wc

March 29, 2009 By: Dexter Category: Regular Expressions, Tutorial

Some times you will come across the requirement of counting how many times a word/pattern has occurred in a file (text).
Here is a simple usage of the command grep and wc to do the same.
lets use the following file for example. (I have named it sample.txt)

Linux is a nice operating system.
Many people thing Linux just has a text based interface.
When people see the GUI on Linux they are really amazed.
Linux was developed by Linus Torvalds.
Linux is to UNIX, so if you have worked on Linux you will be able to work on UNIX also.

Now to count how many time “Linux” occurred in the text you can use:

grep -o ‘Linux’ sample.txt | wc -l

Explaination:
The grep command with -o option searches for the pattern in quotes, in this case ‘Linux’, If you just run the command like that you will get an output like

grep -o ‘Linux’ sample.txt
Linux
Linux
Linux
Linux
Linux
Linux

Now in the actual command

grep -o ‘Linux’ sample.txt | wc -l

When this output is piped to wc -l, which is a word counter tool, with the option -l it counts the number of lines that it receives, and since the output of grep gives each match in a different line, the number of lines are equal to number of occurrences of the text/pattern/word.

Remember grep is case sensitive so use the -i option to ignore case

grep -io ‘Linux’ sample.txt | wc -l

else only ‘Linux’ will be selected all other occurrences will be ignored.

Of course if you are just looking for how many lines have a particular pattern/word occurring and not the count of the word/pattern it self use

grep -c ‘Linux’ sample.txt
OR
grep -ic ‘Linux’ sample.txt // to ignore case

Of course if you are familiar with patterns matching, you can replace ‘Linux’ with your regular expression to look for occurrences of a particular pattern

e.g  ‘(Linux|UNIX|AIX)’  will look for occurrence of Linux or UNIX or AIX.

Note if you are going to use grep do not forge to escape the brackets and the pipe symbol.

Hope that was useful.

NOTE: This explanation is with respect to BASH Shell (GNU bash, version 3.1.17(2)) with grep (GNU grep) 2.5

[end]