Tuesday, April 7, 2009

4. MODULES AND APPLICATION

This project is designed to handle the transactions on images where the Watermarking tasks are performed. The project split into several modules where each module performs or deal with a particular type of transactions.

The modules of the Project are:
· Login & Security
· Image detection
· Image conversion
· Text embossing on images using watermarking
· Image comparison using Hash function.


4.1 Login & Security
The aim of this module is to authenticate the user and provide only restricted access. The password is stored in encrypted form within the database. This is performed using ASCII conversion formula.

4.2 Image Type Detection
Module determines the format of the image selected. Only indexed image file format can be used to perform watermarking. Hence the detection and appropriate exception handling is provided by this module. Image codec is used to determine the image format before using it.

4.3 Image Conversion
The end user may select any image at runtime and hence the format of the image may result in an error during text embossing. The module allows conversion of the source image from one format to the indexed pixel format before it can be used to embed.

4.4 Text Embossing & Watermarking
The text is accepted at runtime. The required % of opacity, location of the text on the image and the colour and font are dynamically specified. The appropriate dialog components are used to specify the font and colours. The code calculates the length of the text in graphics co-ordinates. Using the Graphics class the image can be loaded into memory and reference using an object. This enables in determining the graphics context of the image. As the data to be displayed or associated on the image is text directly putting on the text will create a separate layer as in PowerPoint and although it appears that the text is on the image they are distinguish two layers. To avoid this problem a drawing brush is to be dynamically created that can logically (code) draw the text on the image. The methods of applying the string are applied to embed the data on the image. The end-user can now save the file in its new format as required with the text and image in a single layer or one component.

4.5 Image comparison using Hash function
The easiest way to compare at the first point is to compare the size of the source and target images. If they match the image data (pixels) should be converted to bytes for comparison. Hence a dynamic array should be created as images vary in size. Two arrays one each to hold the first and second image needs to be created. Use the SHA256Managed class to compute the hash for each of the images. The hash is used as a unique value of fixed size representing a large amount of data. Hashes of two sets of data should match if and only if the corresponding data also matches. Small changes to the data result in large unpredictable changes in the hash. The hash size for the SHA256 algorithm is 256 bits. This is an abstract class. The only implementation of this class is SHA256Managed. The System.Security.Cryptography namespace provides cryptographic services, including secure encoding and decoding of data, as well as many other operations, such as hashing, random number generation, and message authentication.

0 comments: