About

Thoughts on Design is a blog on web design and front-end coding. Served up monthly-ish by Jamis Charles.

Search

You are currently browsing the archives for the Photoshop category.

Categories

Archive for the ‘Photoshop’ Category

Break; and continue; in javascript loops


1 of July2008

Break; and continue; statements are essential when working with complex loops. They can be very useful. You can use them to end a loop prematurely, or skip the rest of the loop to start over at the beginning. Here is how you implement it:

<script type="text/javascript">
//build our array
var array1 = new Array();
array1[0] = 0;
array1[1] = 1;
array1[2] = 2;
array1[3] = 3;
array1[4] = 4;

var numArray = array1.length;
for(var i=0; i<numarray ; i++){
	if (array1[i] == 2){
		continue; //skip to the end of the for loop, then start over after incrementing by 1
	}else if (array1[i] == 3){
		break; //end the for loop, and execute code after the loop
	}

	alert("still in for loop: " + i);
}
	alert("after for loop: " + i);
</script>

The above code should have created popups for the numbers “0″, “1″, and “3″. This is because the “continue;” statement makes the code skip to the end of the loop, not executing any of the rest of the loop code, then starts over at the beginning of the loop after incrementing i by 1.

The “break;” statement causes the loop to end and the code after the loop to be executed. i is NOT incremented anymore and thus remains at 3.

You can also use “return;” to just end a function prematurely.

Making an Image look warmer and brighter


15 of May2007

Often we are presented with images that we need to use that do not look very good. This tutorial provides a way to make poor images look better.

  1. In Photoshop, open the offending image.
  2. Duplicate the current image with Layer->Duplicate Layer
  3. Change the blend mode to “overlay style”
  4. Select Image->Adjustments->Hue/Saturation
  5. Reduce the saturation down to a pleasant level
  6. Reduce the opacity on the top image layer until it looks good.
  7. Compare the 2 images by toggling the visibility of the top layer

    Enjoy