It's my gallery for my designed wallpapers on different abstract images, and photography by me!
Wednesday, 29 October 2008
Tuesday, 7 October 2008
Introduction to Ajax
Prototype framework enables you to deal with Ajax calls in a very easy and fun way that is also safe (cross-browser). Besides simple requests, this module also deals in a smart way with JavaScript code returned from a server and provides helper classes for polling.
Ajax functionality is contained in the global Ajax object. The transport for Ajax requests is xmlHttpRequest, with browser differences safely abstracted from the user. Actual requests are made by creating instances of the Ajax.Request object.
new Ajax.Request('/some_url', { method:'get' }); The first parameter is the URL of the request; the second is the options hash. The method option refers to the HTTP method to be used; default method is POST.
Remember that for security reasons (that is preventing cross-site scripting attacks) Ajax requests can only be made to URLs of the same protocol, host and port of the page containing the Ajax request. Some browsers might allow arbitrary URLs, but you shouldn't rely on support for this.
Ajax response callbacks
Ajax requests are by default asynchronous, which means you must have callbacks that will handle the data from a response. Callback methods are passed in the options hash when making a request:
new Ajax.Request('/some_url', { method:'get', onSuccess: function(transport){ var response = transport.responseText || "no response text"; alert("Success! \n\n" + response); }, onFailure: function(){ alert('Something went wrong...') } }); Here, two callbacks are passed in the hash that alert of either success or failure; onSuccess and onFailure are called accordingly based on the status of the response. The first parameter passed to both is the native xmlHttpRequest object from which you can use its responseText and responseXML properties, respectively.
You can specify both callbacks, one or none - it's up to you. Other available callbacks are:
onUninitialized,onLoading,onLoaded,onInteractive,onCompleteandonException.
They all match a certain state of the xmlHttpRequest transport, except for onException which fires when there was an exception while dispatching other callbacks.
Also available are onXXX callbacks, where XXX is the HTTP response status like 200 or 404. Be aware that, when using those, your onSuccess and onFailure won't fire because onXXX takes precedence, therefore using these means you know what you're doing.
The onUninitialized, onLoading, onLoaded, and onInteractive callbacks are not implemented consistently by all browsers. In general, it's best to avoid using these.
Parameters and the HTTP method
You can pass the parameters for the request as the parameters property in options:
new Ajax.Request('/some_url', { method: 'get', parameters: {company: 'example', limit: 12} }); Parameters are passed in as a hash (preferred) or a string of key-value pairs separated by ampersands (like company=example&limit=12).
You can use parameters with both GET and POST requests. Keep in mind, however, that GET requests to your application should never cause data to be changed. Also, browsers are less likely to cache a response to a POST request, but more likely to do so with GET.
One of the primary applications for the parameters property is sending the contents of a FORM with an Ajax request, and Prototype gives you a helper method for this, called Form.serialize:
new Ajax.Request('/some_url', { parameters: $('id_of_form_element').serialize(true) }); If you need to push custom HTTP request headers, you can do so with the requestHeaders option. Just pass name-value pairs as a hash or in a flattened array, like: ['X-Custom-1', 'value', 'X-Custom-2', 'other value'].
If, for some reason, you have to POST a request with a custom post body (not parameters from the parameters option), there is a postBody option exactly for that. Be aware that when using postBody, parameters passed will never be posted because postBody takes precedence as a body - using the option means you know what you're doing.
Evaluating a JavaScript response
Sometimes the application is designed to send JavaScript code as a response. If the content type of the response matches the MIME type of JavaScript then this is true and Prototype will automatically eval() returned code. You don't need to handle the response explicitly if you don't need to.
Alternatively, if the response holds a X-JSON header, its content will be parsed, saved as an object and sent to the callbacks as the second argument:
new Ajax.Request('/some_url', { method:'get', onSuccess: function(transport, json){ alert(json ? Object.inspect(json) : "no JSON object"); } }); Use this functionality when you want to fetch non-trivial data with Ajax but want to avoid the overhead of parsing XML responses. JSON is much faster (and lighter) than XML.
Global responders
There is an object that is informed about every Ajax request: Ajax.Responders. With it, you can register callbacks that will fire on a certain state of any Ajax.Request issued:
Ajax.Responders.register({ onCreate: function(){ alert('a request has been initialized!'); }, onComplete: function(){ alert('a request completed'); } }); Every callback matching an xmlHttpRequest transport state is allowed here, with an addition of onCreate. Globally tracking requests like this can be useful in many ways: you can log them for debugging purposes using a JavaScript logger of your choice or make a global exception handler that informs the users of a possible connection problem.
Updating your page dynamically with Ajax.Updater
Developers often want to make Ajax requests to receive HTML fragments that update parts of the document. With Ajax.Request with an onComplete callback this is fairly easy, but with Ajax.Updater it's even easier!
Suppose you have this code in your HTML document:
<h2>Our fantastic productsh2> <div id="products">(fetching product list ...)div> The 'products' container is empty and you want to fill it with HTML returned from an Ajax response. No problem:
new Ajax.Updater('products', '/some_url', { method: 'get' }); That's all, no more work. The arguments are the same of Ajax.Request, except there is the receiver element in the first place. Prototype will automagically update the container with the response using the Element.update() method.
If your HTML comes with inline scripts, they will be stripped by default. You'll have to pass true as the evalScripts option in order to see your scripts being executed.
But what if an error occurs, and the server returns an error message instead of HTML? Often you don't want insert errors in places where users expected content. Fortunately, Prototype provides a convenient solution: instead of the actual container as the first argument you can pass in a hash of 2 different containers in this form: { success:'products', failure:'errors' }. Content will be injected in the success container if all went well, but errors will be written to the failure container. By using this feature your interfaces can become much more user-friendly.
You might also choose not to overwrite the current container contents, but insert new HTML on top or bottom like you would do with Insertion.Top or Insertion.Bottom. Well, you can. Just pass the insertion object as the insertion parameter to Ajax:
new Ajax.Updater('products', '/some_url', { method: 'get', insertion: Insertion.Top }); Ajax.Updater will use the given object to make the insertion of returned HTML in the container ('products') element. Nifty.
Automate requests with the Ajax.PeriodicalUpdater
You find the Ajax.Updater cool, but want to run it in periodical intervals to repeatedly fetch content from the server? Prototype framework has that, too - it's called Ajax.PeriodicalUpdater, and basically it's running Ajax.Updater at regular intervals.
new Ajax.PeriodicalUpdater('products', '/some_url', { method: 'get', insertion: Insertion.Top, frequency: 1, decay: 2 }); Two new options here are frequency and decay. Frequency is the interval in seconds at which the requests are to be made. Here, it's 1 second, which means we have an Ajax request every second. The default frequency is 2 seconds. Our users might be happy because the responsiveness of the application, but our servers might be taking quite a load if enough people leave their browsers open on the page for quite some time. That's why we have the decay option - it is the factor by which the frequency is multiplied every time when current response body is the same as previous one. First Ajax request will then be made in 1 second, second in 2, third in 4 seconds, fourth in 8 and so on. Of course, if the server always returns different content, decay will never take effect; this factor only makes sense when your content doesn't change so rapidly and your application tends to return the same content over and over.
Having frequency falloff can take the load off the servers considerably because the overall number of requests is reduced. You can experiment with this factor while monitoring server load, or you can turn it off completely by passing 1 (which is default) or simply omitting it.
Move along
Learn more about Ajax.Request, Ajax.Updater and Ajax options.
Monday, 6 October 2008
Sunday, 27 July 2008
Deviantart journal CSS Template Rundown II
Applying the custom divs in your journal
This is the part that may confuse some people without actually being told what to do. This will give you a rough idea of how to use the divs I've provided in my template. Just reading this should give you a good idea of how to create your own.
.journalbox .journaltext .jcustom {
margin: 0px 5px 0px 5px !important;
background-color: #------ !important;
color: #------ !important;
font-size: 11px !important;
padding: 15px 15px 15px 15px !important;
display: block !important;
border-style: solid !important;
border-width: 1px 1px 1px 1px !important;
border-color: #------ !important;
width: auto !important;
}
That is our div for the 'section box' as I like to call them. Just check out this screenshot below on the test journal I did using the same CSS I've provided:
As you can see, there are three differences in the content. The darker background is the main content of your journal. The lighter grey is the custom div I explained above, and the darker grey inside this one is the second div, as shown below.
.journalbox .journaltext .titles {
font-family: 'Trebuchet MS', Verdana, Arial, Helvetica, sans-serif !important;
font-size: 20px !important;
color: #------ !important;
text-align: center !important;
border-style: solid !important;
border-width: 1px 1px 1px 1px !important;
border-color: #------ !important;
background-color: #------ !important;
width: auto !important;
}
So, how does one get it to display like this? Quite easily. If you've been using deviantART journals for a while, you will know how to align your text using
Use something like below. I've put it into a 'tree' type of order, to make more sense of it:
The text that will be displayed in the first div will go here. Eg, if you were talking about your cat, put all the text and ramblings here.
As you can see, we have a div class inside another div class. When writing your journal, you don't have to format it in the way I did above, but you can do it like this:
The text that will be displayed in the first div will go here. Eg, if you were talking about your cat, put all the text and ramblings here.
Each time you want a new box around your content, just do it all over again. Just remember to close the div classes with when you want a box to finish.
Also, remember that in my template, the custom divs have the names .jcustom (the main box around the content) and .titles (the box around the title within the main content box). You don't have to use these for class names. In my own journal CSS, one is for example .nycustom and I have another one for the links the top of my journal which is simply .links.
Also, my template has used a 'long way' for custom divs, to keep the journal structure (this is for beginners afterall), but it can be shorted to something like this if you want to change it and keep it simple:
div.jcustom {
margin: 0px 5px 0px 5px !important;
background-color: #------ !important;
color: #------ !important;
font-size: 11px !important;
padding: 15px 15px 15px 15px !important;
display: block !important;
border-style: solid !important;
border-width: 1px 1px 1px 1px !important;
border-color: #------ !important;
width: auto !important;
}
It works both ways, so it's up to you whether you want to keep using the longer version or use the shortened div.jcustom / div.titles.
If you're still not sure or understand, feel free to ask any questions on the deviation page where you downloaded this tutorial. I'd be happy to answer them or help out. Alternatively, you can just keep reading until you get that "Ohh, I get it". ;)
Oh and if you're wondering what your journal will look like (with the exception of colours), it will look something like below:



Deviantart journal CSS Template Rundown I
This is a rundown of my template. It will explain what each section will do to your journal. What will change what.
.journalbox {
background-color: #------ !important;
border-color: #------ !important;
border-width: 1px !important;
color: #------ !important;
}
This is what contains everything in your journal. You can think of it like a wrapper if you like, holding a chocolate bar. If you look at journals, you can see they have a border around them. This can be changed here, as well as the colour changed.
.journalbox .journaltop {
font-family: Verdana, Arial, Helvetica, sans-serif !important;
font-size: 10px !important;
color: #------ !important;
background-color: #------ !important;
height: 90px !important;
text-align: center !important;
}
Controls the header area of a journal where you find the date and time it was posted etc. Using background-image: url ('url') !important; would apply an image into the header, but since I've removed these from my template, we won't go over it (yet anyway). This section will, as it is now, change the background colour, height, alignment of the test and change the text itself.
.journalbox .journaltop img {
display: none !important;
}
What is this?! Nothing too important. You can delete it if you want to. All it does is remove the journal icon from the header of the journal, which can look pretty good.
.journalbox .journaltop h2 {
font-family: 'Trebuchet MS', Verdana, Arial, Helvetica, sans-serif !important;
font-size: 22px !important;
color: #------ !important;
padding-top: 15px !important;
text-align: center !important;
}
This one controls the title of the journal. Say you title your journal "My Wonderful Journal", this will control how it is displayed to yourself, and everyone else.
.journalbox .list {
background-color: #------ !important;
color: #------ !important;
text-align: center !important;
}
.journalbox .list .a {
background-color: #------ !important;
color: #------ !important;
text-align: center !important;
}
These two will control the display of the currently sections you fill in (or not) when you write a new journal. If you want the rows of these to display as different/alternate colours, just a different colour in .list .a from .list.
.journalbox .journaltext {
color: #------ !important;
font-family: Verdana, Arial, Helvetica, sans-serif !important;
font-size: 11px !important;
padding-top: 0px !important;
padding-left: 15px !important;
padding-right: 15px !important;
background: #------ !important;
text-align: justify !important;
}
This controls the content WITHIN the journal. Like before, think of it like a chocolate bar. The first wrapper holds the whole chocolate bar, and the inner wrapper would be like the chocolate around the inner ingredients of the chocolate bar.
.journalbox .journaltext .jcustom {
margin: 0px 5px 0px 5px !important;
background-color: #------ !important;
color: #------ !important;
font-size: 11px !important;
padding: 15px 15px 15px 15px !important;
display: block !important;
border-style: solid !important;
border-width: 1px 1px 1px 1px !important;
border-color: #------ !important;
width: auto !important;
}
Okay, this is where we start on the custom divs. Divs can add a whole new look to your journal. It can give a different style for each 'section' of your journal, quite like mine, if you've already seen it. Basically, it applies a 1px border around the content, as well as a different background colour from the rest of your journal content. Border styles, widths etc can be changed here too.
.journalbox .journaltext .titles {
font-family: 'Trebuchet MS', Verdana, Arial, Helvetica, sans-serif !important;
font-size: 20px !important;
color: #------ !important;
text-align: center !important;
border-style: solid !important;
border-width: 1px 1px 1px 1px !important;
border-color: #------ !important;
background-color: #------ !important;
width: auto !important;
}
Another custom div, the second one. This has been created to go INSIDE the first one, for the titles of each 'section' of your journal. It's not all that much different from the first div.
.journalbox .journaltext a {
color: #------ !important;
text-decoration: none !important;
}
.journalbox .journaltext a:hover {
color: #------ !important;
text-decoration: underline !important;
}
Controls links within the journal content. a:hover controls the colour and style when your mouse pointer is over the link.
.journalbox .journalbottom {
background-color: #------ !important;
}
Contains the links at the bottom of your journal. You really only need to change the background colour here. In my journal, it has the same background colour as my .journaltop and the .journaltext.
.journalbox .commentslink {
background-color: #------ !important;
color: #------ !important;
font-size: 11px !important;
text-decoration: none !important;
font-weight: bold !important;
}
.journalbox .prevlink {
background-color: #------ !important;
color: #------ !important;
font-size: 11px !important;
text-decoration: none !important;
font-weight: bold !important;
}
These two are pretty straight forward. On the userpage at the bottom of a journal, you will see two links. One leads to the comments of the journal on the userpage. One leads to the previous journal entries. .commentslink obviously controls the link to the comments and .prevlink controls the link to previous journals.
If none of these explainations have helped, ^thespook has a visual aid which might be a little easier to understand, although not everything in my template is shown on it, and just the very basics. You can see it here. An excellent and must have resource, even if you understood this rundown.
Saturday, 29 March 2008
Blue glow dreamy portrait
step 1
Here you can see the original photo and the end result.

step 2
Make a background copy.
Layer>duplicate layer

step 3
We need a bit more contrast.
Layer>
new adjustment layer>
brightness/contrast

step 4
Every time you use a layer adjustment, check (v) -use previous layer to create clipping mask-
In other steps, when we change the color or the levels, we always create a clipping mask.
I used +20 for brightness and contrast, but it differs for every photo, so play a bit with the settings till you are happy about it.

step 5
If you are happy about the contrast, merge the clipping mask.
step 6
With a soft brush on low opacity, soften the skin. You can make a new layer first
Layer>new> layer and work on that, so if you do something wrong, you can erase on that layer and you won't have to start all over again.

step 7
Now we are going to change the color. Layer>new adjustment layer>color balance
Remember to check -use previous layer to create clipping mask-

step 8
Change the color balance to cyan and blue, till you are happy about the result.
step 9
Merge the clipping mask
step 10
Make a second background copy. Layer>duplicate layer
Set the colors in the tools menu to white and pale blue.
You can use the eyedropper tool to pick the colors.
Make sure the pale blue is in the background box (you can use the little arrow to switch them if necessary.
Filter>distort>diffuse glow

step 11
Play a bit with the settings, it has to be soft and not too bright.
step 12
Layer>new adjustment layer>levelsRemember to check -use previous layer to create clipping mask-

step 13
Make the portrait a little bit darker by playing with the levels.
step 14
Merge the clipping mask.
step 15
Make a third background copy. Layer>duplicate layer
Filter>artistic>poster edges

step 16
Make the poster edges softer by playing with the settings.
step 17
Erase the background on the poster edge layer (background copy 3) so the background stays very soft and the girl is sharper.
step 18
Merge background copy 2 and background copy 3ctrl>click both layers>merge

step 19
Now put the white square in the background box.Filter>distort>diffuse glow

step 20
Play with the settings till it's soft and not too bright.
step 21
With a soft brush, I made the background behind her head a bit lighter. After that a last color change.
Layer>new adjustment layer>color balance
Remember to check -use previous layer to create clipping mask-

step 22
A final touch of blue and cyan.
step 23
Finished.
Wednesday, 19 March 2008
Colorful Typography in Photoshop
Let’s start out by creating a new file. I used a 600×300 pixels canvas set at 72dpi, and I filled my background with a black color. Just to be organize make a new layer set and put all your future text layers inside the layer set. Now select the Horizontal Type Tool and set the font family to Bauhus 93, regular, 140 pt, smooth and white color shade. To achieve the final colorful ‘OriginMaker’ text we have to create each letter in its own text layer, in a new text layer type the first letter of your typography.

Step 2:
Under Layer Style (Layer > Layer Style) add a Satin and Gradient Overlay blending options to your first text layer.



Step 3:
In a new text layer type the first letter in black color. Position the black letter as shown below.

Step 4:
Now add another copy this time with a #8A2C00 color shade. Make note of this step if you want different color for your first letter which will be covered in step six and seven.

Step 5:
Under Layer Style (Layer > Layer Style) add an Inner Shadow, Satin and Gradient Overlay blending options to your colored letter layer.




Step 6:
Now add your second letter in this case ‘r’ from OriginMaker. All you have to do is duplicate your layer set with your first letter layers then modify the colored font to a #738100 color shade.


Step 7:
Here are some suggested colors you can use that will work perfect.
#817900
#810000
#730181
#01839A

Step 8:
Add the rest of the letters and your done. You can set them up as you wish, my way of set-up might not work for your name.


Turn A New Photo Into An Old Photo
Here's the image I'll be working with in this tutorial:
And here's what it will look like when we're done:
Of course, there's lots of different ways to age a photo in Photoshop. This, as they say, is one of them.
There's quite a few steps involved, so let's get started!
Step 1: Add A Hue/Saturation Adjustment Layer
With our image newly opened in Photoshop, the first thing we're going to do is replace the photo's bright colors with a classic sepia tone, and we can do that easily using a Hue/Saturation adjustment layer. Click on the New Adjustment Layer icon at the bottom of the Layers palette:

Then choose Hue/Saturation from the list of adjustment layers that appears:

This brings up the Hue/Saturation dialog box. Click inside the checkbox to the left of the Colorize option in the bottom right of the dialog box, then drag the Hue slider to around 40 for a nice sepia tone:

Click OK when you're done to exit out of the dialog box. If we look in our Layers palette now, we can see the Hue/Saturation adjustment layer that we've added above the Background layer (the layer which contains our original image):

And if we look at our image in the document window, we can see that the original color has been replaced with a sepia tone:

Step 2: Merge Both Layers Onto A New Layer
For our next step, we need to have of our existing layers merged on to a new layer above them. To do that, with the adjustment layer still selected in the Layers palette, hold down your Alt (Win) / Option (Mac) key, then while holding the key down, go up to the Layer menu at the top of the screen and select Merge Visible. You can also use the keyboard shortcut for this, which is Shift+Ctrl+Alt+E (Win) / Shift+Command+Option+E (Mac):

Normally when we select the Merge Visible option, Photoshop merges all the layers onto an existing layer in the Layers palette, which is usually not what we want to have happen since we lose the original layers in the process. By holding down the Alt/Option key while selecting Merge Visible (or adding it to the keyboard shortcut), we tell Photoshop to create a brand new layer for us and merge everything onto that new layer while keeping our original layers intact. If we look now in the Layers palette, we can see that sure enough, Photoshop has created a new layer above the previous two layers and has merged the other two layers onto it. We can see our sepia tone image in the new layer's preview thumbnail:

Step 3: Rename The New Layer "Glow"
We're going to use our merged layer to give our image a nice high contrast glow to it, and since we'll be adding a few more layers after that, let's keep track of what we're doing with each layer by giving them more informative names than simply "Layer 1", "Layer 2", and so on. Double-click directly on the name "Layer 1" in the Layers palette and rename it to "Glow":

Of course, you don't have to rename your layers if you feel you don't have that extra 5 seconds of your life to spare, but when you get into some serious Photoshop work where you could easily have hundreds of layers and they all have names like "Layer 10 copy 2" and "Layer 50 copy 7", you'll probably find yourself spending a lot more than 5 seconds trying to find the layer you're looking for.
Step 4: Apply The Gaussian Blur Filter To The Merged Layer
To create our high contrast glow effect, we need to blur out our merged layer. To do that, with the "Glow" layer selected in the Layers palette (I'll assume from here on that you're renaming your layers), go up to the Filter menu at the top of the screen, choose Blur, and then choose Gaussian Blur, which is by far the most commonly used filter for blurring an image in Photoshop:

When the Gaussian Blur dialog box appears, drag the Radius slider at the bottom of the dialog box towards the right until your Radius value is around 6 pixels. I'm working with a low resolution image for this tutorial, but if you're using a high resolution image, you'll want to try a slightly higher setting. You want to apply just enough blur so that you remove most of the detail from the image without going so far that you can't make anything out at all:

Click OK when you're done to exit out of the dialog box. Here's my image after applying the blur to the merged layer. Notice how I've blurred it without going beyond the point where it would be impossible to figure out what's in the photo:

Step 5: Change The Blend Mode Of The Blurred Layer To "Overlay"
Now that we've blurred out our merged layer, go up to the Blend Mode option in the top left corner of the Layers palette. It doesn't actually say "Blend Mode" anywhere, so just look for the selection box that is currently set to "Normal". Click on the down-pointing arrow to bring up a list of available blend modes and select Overlay from the list:

If we look at our image in the document window, we can see that it now has a soft, high contrast glow to it, which is a great effect to use on a photo even if you're not trying to make it appear older:

Step 6: Lower The Opacity Of The "Glow" Layer
If you find, and you most likely will, that your glow effect appears too intense, you can adjust it by simply lowering the opacity of the "Glow" layer. The Opacity option is directly across from the Blend Mode option at the top of the Layers palette. I'm going to lower mine all the way down to about 70%:

If we look at my image again, the glow effect isn't quite as intense as it was before:

Step 7: Add A New Blank Layer And Name It "Edges"
So far in our quest to turn a new photo into an old photo in Photoshop, we've replaced the photo's original colors with a classic sepia tone and we've given our photo a soft glow effect which helps remove some of the finer details from the image. The next thing we'll do is darken the edges of the photo. For that, we'll need a new layer. With the "Glow" layer currently selected in the Layers palette, hold down your Alt (Win) / Option (Mac) key and click on the New Layer icon at the bottom of the Layers palette:
![]()
By holding down the "Alt/Option" key when we click on the "New Layer" icon, we tell Photoshop to pop up the New Layer dialog box for us so we can name the layer before it's added. We can also set some other options in the dialog box, but all we need to do here is name it. Name your layer "Edges":

Click OK when you're done to exit out of the dialog box and Photoshop will add the new layer. If we look in the Layers palette, we can see our new layer, named "Edges", above the other layers:

Step 8: Fill The Layer With Black
We need to fill the new layer with black. To do that, we'll use Photoshop's Fill command. Go up to the Edit menu at the top of the screen and choose Fill, or use the keyboard shortcut Shift+F5. Either way brings up the Fill dialog box. Use the selection box in the Contents section at the top of the dialog box to select Black as the color we want to fill the layer with. Also, make sure in the Blending section in the bottom half of the dialog box that Mode is set to Normal and Opacity is set to 100%. They probably are, but better safe than sorry:

Click OK when you're done to exit out of the dialog box and have Photoshop fill the new layer with black. Your image will now appear filled with solid black in the document window:

Step 9: Select The Elliptical Marquee Tool
Select the Elliptical Marquee Tool from the Tools palette. By default, it's hiding behind the Rectangular Marquee Tool, so you'll need to hold your mouse down on the Rectangular Marquee Tool for a second or two until a fly-out menu appears, then select the Elliptical Marquee Tool from the menu:

Step 10: Drag Out A Large Elliptical Selection
With the Elliptical Marquee Tool selected, click in the top left corner of the image and drag down to the bottom right corner, which will create a large elliptical selection inside the document:

Step 11: Add A Layer Mask
We're going to use our elliptical selection to punch a hole through the solid black fill, allowing us to see our photo underneath, and we can do that by adding a layer mask. Now, whenever we add a layer mask with a selection active, Photoshop uses the selection to determine which part(s) of the layer should remain visible and which part(s) should be hidden. By default, anything inside the selection remains visible, while anything outside the selection becomes hidden from view. That means that if we were to add a layer mask right now with our elliptical selection active, Photoshop would keep the solid black fill area inside the selection visible and it would hide the area outside the selection, which is exactly the opposite of what we want. We want the area inside the selection to be hidden so we can see our photo underneath, while the area outside the selection remains visible.
We need to tell Photoshop to do the exact opposite of what it normally would when we add our layer mask, and we can do that simply by holding down the Alt (Win) / Option (Mac) key and then clicking on the Layer Mask icon at the bottom of the Layers palette:

We can see in the Layers palette now that Photoshop has added a layer mask thumbnail to the "Edges" layer, and we can see in the thumbnail that the area inside the selection was filled with black, which means it's being hidden from view, while the area outside the selection was filled with white, meaning it remains visible in the document:
![]()
And if we look at the image in the document window, we can see that we've successfully punched a hole through the solid black fill, allowing us to see our photo through it:

Just as a side note before we continue, you may have noticed that this was the third time in this tutorial that we've managed to do something a little differently by holding down the Alt/Option key when we did it. The next time you go to do something in Photoshop, try holding down your Alt/Option key while you do it and see what happens. The worst that will happen is absolutely nothing. But who knows that sorts of little-known features you may discover!
Step 12: Apply The Gaussian Blur Filter
At the moment, all we've really created is a rather uninteresting photo frame. Let's apply Photoshop's Gaussian Blur filter to the "Edges" layer to soften the transition between the solid black area and the photo. With the "Edges" layer selected in the Layers palette, go up to the Filter menu just as we did before, choose Blur, and then choose Gaussian Blur to once again bring up the Gaussian Blur dialog box. Drag the Radius slider at the bottom towards the right and as you drag, you'll see the sharp edge separating the black area from the photo begin to blur and soften. I'm going to increase my Radius value to somewhere around 25 pixels. For a high resolution image, you'll want to use an even higher setting, maybe around 40 pixels or so:

Click OK when you're done to exit out of the dialog box and apply the blurring effect. Here's my image now with a smooth transition between the outer black area and the photo:

Step 13: Lower The Opacity Of The "Edges" Layer
The only problem remaining with our darkened edge effect is that the solid black area is completely blocking the areas of the photo underneath it from view. We want to darken the edges of the photo, not cover them up. As a final step then with our edge effect, all we need to do is lower the opacity of the "Edges" layer. With the "Edges" layer still selected, go up to the Opacity option at the top of the Layers palette and lower the opacity value all the way down to around 35%:

This gives us a much more subtle edge darkening effect:

Step 14: Add A New Blank Layer And Name It "Noise"
At this point, we're done with our edge effect, so let's move on by adding a little noise to the image, giving it a slightly grainy look. Again, we'll need a new layer for this, so once again hold down your Alt (Win) / Option (Mac) key and click on the New Layer icon at the bottom of the Layers palette:

Just as before, by holding down "Alt/Option", we tell Photoshop to pop up the New Layer dialog box which allows us to name the new layer before it's added. Name this layer "Noise":

Click OK when you're done to exit out of the dialog box, at which point Photoshop creates a new blank layer for us at the top of the Layers palette and names it "Noise":

Step 15: Fill The New Layer With Black
Again, we're going to fill this new layer with black, so let's again bring up Photoshop's Fill command by going up to the Edit menu and choosing Fill or by using the keyboard shortcut Shift+F5. When the Fill dialog box comes up, you should see that all of the options are automatically set to the way we set them last time, with the Contents section at the top set to Black, the Mode option set to Normal and the Opacity option set to 100%:

Click OK to accept the options and exit out of the dialog box. Photoshop again fills the new layer with black:

Step 16: Add Noise
With the "Noise" layer selected, go up to the Filter menu at the top of the screen, choose Noise, and then choose Add Noise:

This brings up Photoshop's "Add Noise" dialog box. We want to add a lot of noise, so drag the Amount slider to somewhere around 130% or so. There's no exact value to set it to. Just make sure you're adding lots of noise. Also, make sure you select the Gaussian and Monochromatic options at the bottom of the dialog box:

Click OK to exit out of the dialog box. Your image in the document window will now appear completely filled with black and white noise:

Step 17: Change The Blend Mode Of The "Noise" Layer To "Soft Light"
We need to blend all that noise into our image, and the first step in doing that is to change the layer's blend mode. With the "Noise" layer still selected, go up to the Blend Mode option in the top left corner of the Layers palette and change it from "Normal" to Soft Light:

As soon as you change the blend mode to "Soft Light", you'll be able to see your photo through the noise, even though there's still far too much of it:

Step 18: Lower The Opacity Of The "Noise" Layer
Go up to the Opacity option at the top of the Layers palette and lower the opacity of the "Noise" layer all the way down to somewhere between 10-15% so there's just a hint of graininess remaining. I'm going to lower mine to 13%:

Here's my photo now after lowering the opacity of the noise:

Another effect complete! Now let's add a little bit of wear and tear to the image by creating a few specks of dust and some scratches. Nothing extreme, just a subtle amount.
Step 19: Add A New Layer Named "Grain" And Fill It With Black
We need yet another new layer and we need to fill it with black. Since we've already done this twice, I'll save us a little time here and combine the whole process into one step. Hold down your Alt (Win) / Option (Mac) key and click on the New Layer icon at the bottom of the Layers palette. When the New Layer dialog box appears, name the layer Grain. We're naming it that because we'll be using Photoshop's "Grain" filter in a moment. Click OK to exit out of the dialog box and have Photoshop add the new layer at the top of the Layers palette.
Then, to fill the layer with black, go up to the Edit menu at the top of the screen and choose Fill or use the keyboard shortcut Shift+F5. When the Fill dialog box appears, make sure all the options are still set to the way we had them before, with Contents set to Black, Mode set to Normal and Opacity set to 100%, then click OK to exit out of the dialog box and have Photoshop fill the new layer with black.
When you're done, you should have a new layer at the top of your Layers palette named "Grain", and the layer should be filled with solid black:

Your image in the document window will also once again be filled with black.
Step 20: Apply The "Grain" Filter
We're going to use Photoshop's "Grain" filter to add a little wear and tear to our image by adding some dust and scratches. Again, we're not going for an extreme amount of wear and tear here, just a little something to help make the photo look like it's been sitting in someone's shoe box for a few years. With the new "Grain" layer selected in the Layers palette, go up to the Filter menu at the top of the screen, choose Texture, and then choose Grain:

When the Grain filter dialog box appears, first set the Grain Type option to Vertical, then increase the Intensity value to around 70 and the Contrast value to around 80. You may need to play around with those values a bit while keeping an eye on the preview area. What you're looking for is just a few broken vertical white lines which will become dust and scratches on the image:

Click OK when you're done to exit out of the dialog box. If you look at your image in the document window, you should see something like this:

Step 21: Change The Blend Mode Of The "Grain" Layer To "Screen"
To turn those white dots and lines into something that looks more like dust and scratches, simply go up to the Blend Mode option at the top of the Layers palette and change the "Grain" layer's blend mode from "Normal" to Screen:

The "Screen" blend mode will instantly hide all the black areas on the layer, leaving only the white dots and lines visible, creating our subtle dust and scratches effect:

You may be wondering why we named this layer "Grain" and not something more obvious like "Dust & Scratches". The reason is simply because there is an actual Dust & Scratches filter in Photoshop which is used to remove things like, well, dust and scratches. To avoid confusion, I thought it would be easier to name the layer based on the name of the filter we used to create the effect, which was the "Grain" filter. It doesn't really matter what name you give to your layers as long as the name makes sense to you.
Step 22: Add A "Levels" Adjustment Layer
One of the things that tends to happen to photos over time is that they begin to fade. The deep blacks and bright whites in the image become dark and light shades of gray, resulting in a loss of contrast in the photo and an overall "dull" appearance. Normally, Photoshop's Levels command is used to restore those shadows and highlights that have fallen victim to the ravages of time, but we can just as easily use Levels to advance the aging process.
Before we can do anything though, we need to add a Levels adjustment layer, so with the "Grain" layer still selected, click on the New Adjustment Layer icon at the bottom of the Layers palette and select Levels from the list:

Step 23: Reduce The Overall Contrast Of The Image With The Output Sliders
When the Levels dialog box appears, look down at the very bottom and you'll see a gradient bar going from black on the left to white on the right, with two small sliders below it on either end - a black one on the left and a white one on the right. These are called output sliders and they control the maximum tonal range of an image. We can use them to control how dark the blacks in an image can appear and how bright the whites can appear.
As I mentioned a moment ago, the deep blacks in a photo tend to lighten over time, so to lighten the blacks in our image, simply click on the black slider on the left and drag it towards the right. As you drag, you'll see the darkest parts of the image begin to lighten. We don't want to go too far, so continue dragging until you've set the number in the left value box of the Output Levels option to around 30:

The bright whites in the photo need to be darkened a little as well, so click on the white slider on the right and begin dragging it towards the left. As you drag, you'll see the brightest areas in the image begin to fade. Again, we don't want to go too far, so drag the slider until you've set the number in the right value box of the Output Levels option to around 235:

Click OK when you're done to exit out of the Levels dialog box. If we look in our Layers palette, we can see the Levels adjustment layer that we've added:

And if we look at our image, we can see that it has now lost a bit of its overall contrast. To make it easier to see what we've done, I've split my photo up into a "before and after" image. The left side is how the image looked before fading it with the Levels adjustment layer, and the right side is how it appears after fading it. Notice how the blacks are no longer pure black and the whites are no longer pure white:

We're just about done, and you could actually stop here if you wanted to. But as a final step, I'm going to bring back just a hint of the photo's original color, and I'll do that next!
Step 21: Change The Blend Mode Of The "Grain" Layer To "Screen"
To turn those white dots and lines into something that looks more like dust and scratches, simply go up to the Blend Mode option at the top of the Layers palette and change the "Grain" layer's blend mode from "Normal" to Screen:

The "Screen" blend mode will instantly hide all the black areas on the layer, leaving only the white dots and lines visible, creating our subtle dust and scratches effect:

You may be wondering why we named this layer "Grain" and not something more obvious like "Dust & Scratches". The reason is simply because there is an actual Dust & Scratches filter in Photoshop which is used to remove things like, well, dust and scratches. To avoid confusion, I thought it would be easier to name the layer based on the name of the filter we used to create the effect, which was the "Grain" filter. It doesn't really matter what name you give to your layers as long as the name makes sense to you.
Step 22: Add A "Levels" Adjustment Layer
One of the things that tends to happen to photos over time is that they begin to fade. The deep blacks and bright whites in the image become dark and light shades of gray, resulting in a loss of contrast in the photo and an overall "dull" appearance. Normally, Photoshop's Levels command is used to restore those shadows and highlights that have fallen victim to the ravages of time, but we can just as easily use Levels to advance the aging process.
Before we can do anything though, we need to add a Levels adjustment layer, so with the "Grain" layer still selected, click on the New Adjustment Layer icon at the bottom of the Layers palette and select Levels from the list:

Step 23: Reduce The Overall Contrast Of The Image With The Output Sliders
When the Levels dialog box appears, look down at the very bottom and you'll see a gradient bar going from black on the left to white on the right, with two small sliders below it on either end - a black one on the left and a white one on the right. These are called output sliders and they control the maximum tonal range of an image. We can use them to control how dark the blacks in an image can appear and how bright the whites can appear.
As I mentioned a moment ago, the deep blacks in a photo tend to lighten over time, so to lighten the blacks in our image, simply click on the black slider on the left and drag it towards the right. As you drag, you'll see the darkest parts of the image begin to lighten. We don't want to go too far, so continue dragging until you've set the number in the left value box of the Output Levels option to around 30:

The bright whites in the photo need to be darkened a little as well, so click on the white slider on the right and begin dragging it towards the left. As you drag, you'll see the brightest areas in the image begin to fade. Again, we don't want to go too far, so drag the slider until you've set the number in the right value box of the Output Levels option to around 235:

Click OK when you're done to exit out of the Levels dialog box. If we look in our Layers palette, we can see the Levels adjustment layer that we've added:

And if we look at our image, we can see that it has now lost a bit of its overall contrast. To make it easier to see what we've done, I've split my photo up into a "before and after" image. The left side is how the image looked before fading it with the Levels adjustment layer, and the right side is how it appears after fading it. Notice how the blacks are no longer pure black and the whites are no longer pure white:

We're just about done, and you could actually stop here if you wanted to. But as a final step, I'm going to bring back just a hint of the photo's original color, and I'll do that next!
Step 24: Select The Hue/Saturation Layer
As I mentioned at the end of the previous page, this last step is optional. I'm going to bring back some of the photo's original color, as if the color in the photo has also faded over time.
If you remember from the very beginning of the tutorial, we replaced the photo's original color with a sepia tone using a Hue/Saturation adjustment layer. The original photo with all of its original colors is sitting safely below that adjustment layer on the Background layer. To bring back some of the color, all we need to do is lower the opacity of that Hue/Saturation layer.
First, we need to select it, so click on the Hue/Saturation adjustment layer in the Layers palette:

Step 25: Lower The Layer's Opacity
With the Hue/Saturation adjustment layer selected, go up to the Opacity option at the top of the Layers palette and lower the opacity to around 90%:

This brings back 10% of the photo's original color, and with that, here's my final "old photo" result:

About Shinegrafix
- Danyal Ali Butt
- Hi Guys, Shinegrafix is a gellery for my work like Abstract wallpapers, Photo Manipulation, Designing and Photography. Well there are some information about me. Basically i am a Programmer, but i love to work with images & photography also. that you will see here or you can visit SHINEGRAFIX
