Image compression is used to minimize the amount of memory needed to represent an image. Images often require a large number of bits to represent them, and if the image needs to be transmitted or stored, it is impractical to do so without somehow reducing the number of bits. The problem of transmitting or storing an image affects all of us daily. TV and fax machines are both examples of image transimission, and digital video players and web picture are examples of image storage.
In this project We attempted to implement basic JPEG compression using only basic Matlab functions. This include going from a basic grayscale bitmap image all the way to a fully encoded file readable by standard image readers. We will show that We have implemented the majority of the project, including much of the final binary coding.
Step1: Converting the base image to 8x8 matrices, DCT transform, quantizing
These steps were relatively easy, especially in matlab, which is specifically set up to work with matrices. The 2-D discrete cosine transform is done simply with the dct2() command. After splitting the matrix into 8x8 matrices and performing the DCT, a simple piecewise division by the quantization matrix obtains the quantized matrices needed for the next step.
Step 2: Zig-Zag Encoding of Quantized Matrices
I found no matlab implementation for this function, so I wrote one myself. I took advantage of the fact that each diagonal row has addresses that add up to the same number. Depending on whether the number is even or odd determined the direction of the iteration through the row. The code I wrote is able to zig-zag through any matrix of equal height and width. This could be useful if one wanted to experiment with deviding images into matrices larger than 8x8.
Step 3: Conversion of quantized vectors into the JPEG defined bitstream
For this step, I started with an old implementation of the default AC code written by Yu Hen Hu. After updating the code to work with Matlab 7 I modified the code to encode the first number in the incoming vector with the default DC code, the table for which I added to the file. The function returns a completed bitstream to correspond to the input of the quantized vector.
Step 4: Construction of the JPEG File header, Writing the File
The JPEG file is broken into many blocks. Each block begins with two bytes, the first being FF in hexadecimal and the second being ‘XX’ where different ‘XX’s denoting different blocks. The second part of each block is the length, in bytes, of the block including the two length bytes. The rest of the block contains the data as defined by the block type.
INTRODUCTION OF DCT
Web application causes a Web server to send HTML code to a client. That code is displayed in a Web browser like Internet Explorer. When a user enters a URL string in the browser, an HTTP request is sent to the Web server. The HTTP request contains the filename that is requested along with additional information such as a string identifying the client application, the languages that the client supports, and additional data that belongs to the request. The Web server returns an HTTP response that contains HTML code, which is interpreted by the Web browser to display text boxes, buttons, and lists to the user.
What is ASP.NET?
ASP.NET is a technology for dynamically creating Web pages with server-side code. These Web pages can be developed with many similarities to client-side Windows programs. Instead of dealing directly with the HTTP request and response and manually creating HTML code to send to the client, you can use controls such as TextBox, Label, ComboBox and Calendar, which create HTML code themselves.
ASP.NET is not just a simple upgrade or the latest version of ASP. ASP.NET combines unprecedented developer productivity with performance, reliability, and deployment. ASP.NET redesigns the whole process. It's still easy to grasp for new comers but it provides many new ways of managing projects.
Below are the features of ASP.NET.:-
1) Easy Programming Model:-
ASP.NET makes building real world Web applications dramatically easier. ASP.NET server controls enable an HTML-like style of declarative programming that let you build great pages with far less code than with classic ASP. Displaying data, validating user input, and uploading files are all amazingly easy. Best of all, ASP.NET pages work in all browsers including Netscape, Opera, AOL, and Internet Explorer.
2) Flexible Language Options:-
ASP.NET lets you leverage your current programming language skills. Unlike classic ASP, which supports only interpreted VBScript and JScript, ASP.NET now supports more than 25 .NET languages (built-in support for VB.NET, C#, and JScript.NET), giving you unprecedented flexibility in your choice of language.
3) Great Tool Support:-
You can harness the full power of ASP.NET using any text editor, even Notepad. But Visual Studio .NET adds the productivity of Visual Basic-style development to the Web. Now you can visually design ASP.NET Web Forms using familiar drag-drop-doubleclick techniques, and enjoy full-fledged code support including statement completion and color-coding. VS.NET also provides integrated support for debugging and deploying ASP.NET Web applications. The Enterprise versions of Visual Studio .NET deliver life-cycle features to help organizations plan, analyze, design, build, test, and coordinate teams that develop ASP.NET Web applications. These include UML class modeling, database modeling (conceptual, logical, and physical models), testing tools (functional, performance and scalability), and enterprise frameworks and templates, all available within the integrated Visual Studio .NET environment.
`4) Compiled execution:-
ASP.NET is much faster than classic ASP, while preserving the "just hit save “update model of ASP. However, no explicit compile step is required. ASP.NET will automatically detect any changes, dynamically compile the files if needed, and store the compiled results to reuse for subsequent requests. Dynamic compilation ensures that your application is always up to date, and compiled execution makes it fast. Most applications migrated from classic ASP see a 3x to 5x increase in pages served.
4) Rich output caching:-
ASP.NET output caching can dramatically improve the performance and scalability of your application. When output caching is enabled on a page, ASP.NET executes the page just once, and saves the result in memory in addition to sending it to the user. When another user requests the same page, ASP.NET serves the cached result from memory without re-executing the page. Output caching is configurable, and can be used to cache individual regions or an entire page. Output caching can dramatically improve the performance of data-driven pages by eliminating the need to query the database on every request.
5) Easy Deployment:-
ASP.NET takes the pain out of deploying server applications. "No touch" application deployment. ASP.NET dramatically simplifies installation of your application. With ASP.NET, you can deploy an entire application as easily as an HTML page; just copy it to the server. No need to run regsvr32 to register any components, and configuration settings are stored in an XML file within the application.
6) Dynamic update of running application:-
ASP.NET now lets you update compiled components without restarting the web server. In the past with classic COM components, the developer would have to restart the web server each time he deployed an update. With ASP.NET, you simply copy the component over the existing DLL; ASP.NET will automatically detect the change and start using the new code. Easy Migration Path You don't have to migrate your existing applications to start using ASP.NET. ASP.NET runs on IIS side-by-side with classic ASP on Windows 2000 and Windows XP platforms. Your existing ASP applications continue to be processed by ASP.DLL, while new ASP.NET pages are processed by the new ASP.NET engine. You can migrate application by application, or single pages. And ASP.NET even lets you continue to use your existing classic COM business components.
Using ASP.NET for Web applications on the client system just a simple Web browser is needed. You can use Internet Explorer, Opera, Netscape Navigator, Firefox, or any other Web browser that supports HTML. The client system doesn't require .NET to be installed.
On the server system, the ASP.NET runtime is needed. If you have Internet Information Services (IIS) on the system, the ASP.NET runtime is configured with the server when the .NET Framework is installed. If you have Windows XP Home Edition on your developer system, IIS is not available. With Visual Studio 2005, this is not a problem anymore because the Visual Web Developer Web Server is part of Visual Studio and can be used to test your Web applications.
Let's look at a typical Web request from a browser to show how the ASP.NET runtime goes into action The client requests a file, for example default.aspx, from the server. All ASP.NET Web pages usually have the file extension .aspx. Because this file extension is registered with IIS, or known by the Visual Web Developer Web server, the ASP.NET runtime and the ASP.NET worker process get into the picture. With the first request to the file default.aspx, the ASP.NET parser is started, and the compiler compiles the file together with a C# file that is associated with the .aspx file and creates an assembly. Then the assembly is compiled to native code by the JIT compiler of the .NET runtime. The assembly contains a Page class that is invoked to return HTML code to the client. Then the Page object is destroyed. However, the assembly is kept for the next requests, so with the second request it is not necessary to compile the assembly again.