JavaPCD - A Web-Based Digital Image Processing Tutorial
(JavaPCD - Tutorial Pengolahan Citra Digital Berbasis Web)

(C) 2005 Setyo Nugroho, http://www.snpages.info/
STMIK STIKOM Balikpapan
Jl Kapten P Tendean 2A Balikpapan, Indonesia
[Current version: 1.45]
Bahasa Indonesia | English

This page contains a web-based digital image processing basics tutorial using Java technology. To access this tutorial you will need a web browser that supports Java applet, for example: Internet Explorer, Firefox, Opera, atau Netscape Navigator. It is also suggested that you use at least 800x600 pixels screen resolution, with 16-bit (high-color) or higher color depth.

If you can not see the applet above this text, it means that Java applet support in your browser is not enabled, or your browser does not support Java applet.

In this tutorial you can make interactive experiments in basic digital images processing. Currently these features are available:

The result of any image processing will be displayed on your screen immediately.

DIGITAL IMAGE AND CONTRAST STRETCHING

Image is defined as light intensity function in two dimension f(x,y) where x and y represent spatial coordinat, and the value of f at any point (x,y) sebanding with the brigthness usually stated as grayscale level of image at that point A digital image is an image where the value of f(x,y) is digitized (made discrete) in its coordinat spatial as well as its graylevel value. Digitization of the spatial coordinat of an image is called image sampling, while digitization of the graylevel value of an image is called gray-level quantization. Digital image can be considered as a matriks where the values contained in its rows and columns represent the graylevel value at those points. The elements of digital image is usually called pixel, originated from picture elements.

The goal of digital image processing is to obtain a new image which is more suitable for a particular application. One of the kind of image processing is what is called contrast stretching.
Contrast stretching is a technique used to produce a new image with a better contrast than that of the original one. Image with low contrast could resulted from lack of the light, lack of the dynamic field of image sensor, or error of lens setting when image is acquired. The idea of contrast stretching is basically to increase the dynamic field of graylevel value in the image.

Transformasi Nilai Intensitas Pixel pada Contrast Stretching

Figure 1. Transformation of pixel intensity value in Contrast Stretching

Figure 1 show one of the transformation that can be used in contrast stretching. We assume here that the image have graylevel value ranged from 0 to 255. In that figure, c is the gray level value of the original image, and d is gray level value of the resulted image. Point (c1,d1) and (c2,d2) will determine the form of the transformation, and they can be adjusted to determine how far the distribution of gray level value of the resulted image. If c1=c2 and d1=d2, transformation will be a straight line that means there is no change in the gray level of the resulted image. Generally we assume that c1<=c2 and d1<=d2. To calculate the resulted value from this transformation we can use the following three functions:

Have an enjoyable experiment with JavaPCD...

Notes:
Image on the left side is the original image, while image on the right side is resulted image after processed. Below each of those images is the image histogram. To make changes, choose Brightness or Contrast in the provided combobox. Then use mouse to change the value of the scrollbar. Reset button can be used to return to the original image. You can also choose another image by using the available combo box.

If you want to run this tutorial with your own image files, you can download file javapcd.zip (~45 KB), the extract the files in a new folder in your harddisk. Then copy your image files in that same folder. Next, open file javapcd.htm by text-based editor (e.g. Notepad, vi, KWrite, atau GEdit). Edit in by inserting your own image file names or overwriting the older ones in the list of image file names already existed. Use commas to separate between different file names. Save the file javapcd.htm, and now you can use web browser to open the file javapcd.htm.

Source code is available to download.

Thanks to Atisatya for her contribution in several parts of this tutorial.

Bahasa Indonesia | English

(C) 2005 Setyo Nugroho, http://www.snpages.info/