SlideShare a Scribd company logo
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013



                  Scaling Transform Methods For
                 Compressing a 2D Graphical image
                                       Ms. A. J. Rajeswari Joe

                            Research Scholar, Bharathiyar University
                            Assistant Professor, Department of MCA,
                             GSS Jain College for Women, Chennai

                                         rajoes@yahoo.com

                                             Dr. N. Rama

                         Research Supervisor, Bharathiyar University
                     Assistant Professor, Department of Computer Science,
                                  Presidency College, Chennai

ABSTRACT

Transformation is a process of converting the original picture coordinates into a different picture
coordinates either by adding some values with original coordinates(Translations) or Multiplying some
values with original coordinates(called Linear transformations like rotation, reflection, scaling, and
shearing). In this paper, we compress a two dimensional picture using 2D scaling transformation. In the
several scenarios, the utilization of this technique for image compression resulted in comparable or better
performance, when compared to the Different modes of image transformations. In this paper We tried a
new code for compressing an 2d gray scale image using scaling transform methods. Matlab concepts are
applied to compress the image. We have plan to apply The techniques and develop a code for compressing
a 3d image.

KEYWORDS

Scaling factors (compression factors), two dimensional scaling transformation, decompression,
experimental result,.

1. Introduction

Scaling is the process of expanding or compressing the dimensions (i.e., size) of an object. An
important application of scaling is in the development of viewing transformation, which is a
mapping from a window used to clip the scene to a view port for displaying the clipped scene on
the screen. In Euclidean geometry, changing the size of an object is called a scale. We scale an
object by scaling the x and y coordinates of each vertex in the object uniform scaling (or isotropic
scaling,) is a linear transformation that enlarges (increases) or shrinks (diminishes) objects by a
scale factor that is the same in all directions. The result of uniform scaling is similar (in the
DOI : 10.5121/acij.2013.4204                                                                            41
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013
geometric sense) to the original. A scale factor of 1 is normally allowed, so that congruent shapes
are also classed as similar. More general is scaling with a separate scale factor for each axis
direction. Non-uniform scaling (anisotropic scaling) is obtained when at least one of the scaling
factors is different from the others; a special case is directional scaling or stretching (in one
direction). Non-uniform scaling changes the shape of the object; e.g. a square may change into a
rectangle, or into a parallelogram if the sides of the square are not parallel to the scaling axes (the
angles between lines parallel to the axes are preserved, but not all angles). In this paper we have
compressed lena’s image which is a grayscale 2d image using Matlab coding. 2-D Dimensional
Cosine Transform is applied on Lena’s image (352*352) as a test image. DCT is applied to
lena’s image through scaling factor 2, scaling factor 4 and scaling factor 8, and the result is
analysed. The results are then compared with various compression methods. We used Peak
Signal-to Noise Ratio (PSNR) and Mean Square Error (MSE) to observe the quality of the
compressed image and original image.

2.Scaling factors(compression factors)

A scaling transformation alters the size of an object. The operation is accomplished by
multiplying each coordinate by scaling factors Sx, Sy . When (Sx Sy,) < 1 the object or image is
compressed. Where Sx , Sy are the scaling factors along each axis with respect to the local
coordinate system of the model. The scaling transformation allows a transformation matrix to
change the dimensions of an object by shrinking or stretching along the major axes centered on
the origin. It should be noted that the scaling is always about the origin along each dimension
with the respective scaling factors. This means that if the object being scaled does not overlap the
origin, it will move farther away if it is scaled up, and closer if it is scaled down. Scaling with
respect to a selected fixed position (Sx Sy) can be represented with the following transformation
sequence:

1. Translate the fixed point to the origin
2. Scale the object relative to the coordinate Origin
3. Translate the fixed point back to its original Position.

3. Two Dimensional Scaling
Let Sx , Sy be the scale in the positive x and y directions respectively. Then the scaled vertex is
given by




If, Sx = Sy=S then it is said to be homogenous or uniform scaling[4] transformation that
maintains relative proportions of the scaled objects. The Magnification factor is |s|. All points
move s times away from the origin. If |s| < 1, all the points move towards the origin, or
demagnetized.

                                                                                                    42
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013




                    Fig1. Scaling the original picture with scale factors Sx=-1, Sy= 2

If Sx ≠ Sy then the scaling is called differential scaling. When either Sx or Sy equals to one,
simplest differential scaling. 2-Dimensional scaling in the matrix form is given by




In the case where Sx =Sy = k, scaling increases the area of any surface by a factor of k2 and the
volume of any solid object by a factor of k3. Such a scaling changes the diameter of an object by a
factor between the scale factors, the area by a factor between the smallest and the largest product
of two scale factors, and the volume by the product of all two.
We can represent a triangle, shown in matrix form, [5] using homogeneous coordinates of the
vertices as :
                                  A0 0 1
                                  B1 1 1
                                  C5 2 1



By choosing the scaling factor s=1/2

The matrix of scaling for compressing an image is:

                        ½ 0 0
    (S(1/2,1/2) )      0 ½ 0
                        0 0 1
Multiply original matrix coordinates with matrix of scaling results the coordinates of either
compressed image or decompressed image based on the scaling factors selected.

So the new coordinates A’B’C’ of the scaled triangle ABC can be found as:

A0 0 1         ½ 0 0        A 0 0 1
B1 1 1         0 ½ 0        B ½ ½ 1
C5 2 1         0 0 1        C 5/2 1 1
                                                                                                43
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013
Thus, the new coordinates are A’=(0,0), B’=(1/2, 1/2), C’= (5/2, 1)




                     Figure2: Object after scaling with Sx = Sy = 1/2 (Compressed picture)


4. Decompression
The inverse scaling matrix[4] is obtained by replacing sx and sy with 1/sx and 1/sy.




The scaling discussed so far has the origin (0,0) as the fixed point and scaling is about the origin.
When an object is scaled, it is moved sx and sy times away from the origin. It is also possible to
have any arbitrary point as a fixed point, and scale about that point.

We can represent a triangle, shown          in matrix form, using homogeneous coordinates of the
vertices as :
                             A0 0           1
                             B1 1           1
                             C5 2           1

choosing scaling factor s=2

The matrix of scaling for decompression is:

                      2 0 0
    (S(2,2) )        0 2 0
                      0 0 1
So the new coordinates A’B’C’ of the scaled triangle ABC can be found as:

A0 0 1          2 0 0          A 0 0 1
B1 1 1          0 2 0          B 2 2 1
C5 2 1          0 0 1          C 10 4 1
                                                                                                  44
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013
Thus, A’=(0,0), B’=(2,2), C’= (10, 4)

    The following figure (3) shows the effect of scaling with sx=sy =2.




                  Figure2: Object after scaling with 1/sx and 1/sy. (i.e) Sx = Sy = 2
                                     (DeCompressed picture)

5. Related Work

5.1 The Discrete Cosine Transform

DCT Attempts to decorrelate the image data after decorrelation each transform coefficient can be
encoded without dropping off compression efficiency[7]. DCT separates images into parts of
different frequencies where less important frequencies are discarded through quantization and
important frequencies are used to retrieve the image during decompression. Compared to other
input dependent transforms, DCT has many advantages: (1) It has been implemented in single
integrated circuit; (2) It has the ability to pack most information in fewest coefficients; (3) It
minimizes the block like appearance called blocking artifact that results when boundaries
between sub-images become visible

5.2 The One-Dimensional DCT

The DCT of a list of n real numbers s(x), [8]
where x=0, 1, ….., n-1, is the list of length n given by:




For u= 0, 1, 2, … N-1.
Similarly, the inverse transform is [5]defined as

                                                                                               45
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013




Thus, the first transform coefficient is the coefficient is the average value of the sample sequence

5.3 The Two-Dimensional DCT

The Discrete Cosine Transform (DCT) is one of many transforms that takes its input and
transforms it into a linear combination of weighted basis functions. These basis functions [11]are
commonly the frequency. The 2-D Discrete Cosine Transform is just a one dimensional DCT
applied twice, once in the x direction, and again in the y direction. One can imagine the
computational complexity of doing so for a large image. Thus, many algorithms, such as the Fast
Fourier Transform (FFT), have been created to speed the computation.

The DCT computes the i, jth entry of the DCT of an image.




N is the size of the block that the DCT is applied on. The equation [7]calculates one entry (i, jth)
of the transformed image from the pixel values of the original image matrix. For the standard 8*8
block that JPEG compression uses, N equals * and x and y range from 0 to 7. Therefore D (I,j)
would be as in equation:




Because the DCT uses cosine functions, the resulting matrix depends on the horizontal and
vertical frequencies. Therefore an image block with a lot of change in has a very random looking
resulting matrix of a large value for the first element and zeroes for the other element.

6. Experimental Result
    •   Original image is divided into blocks of 8 x 8.
    •   Pixel values of a black and white image range from 0-255 but DCT is designed to work
        on pixel values ranging from -128 to 127 .Therefore each block is modified to work in
        the range.

                                                                                                  46
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013
    •   DCT is applied to each block by multiplying the modified block with DCT matrix on the
        left and transpose of DCT matrix on its right.
    •   Each block is then compressed through quantization.
    •   Quantized matrix is then entropy encoded.
    •   Compressed image is reconstructed through reverse process.
    •   Inverse DCT is used for decompression.

6.1 Quantization

Quantization is achieved by compressing a range of values to a single quantum value. When the
number of discrete symbols in a given stream is reduced, the stream becomes more compressible.
A quantization matrix is used in combination with a DCT coefficient matrix to carry out
transformation. Quantization is the step where most of the compression takes place.DCT really
does not compress the image because it is almost lossless. Quantization makes use of the fact that
higher frequency components are less important than low frequency components. It allows
varying levels of image compression and quality through selection of specific quantization
matrices. Thus quality levels ranging from 1 to 100 can be selected, where 1 gives the poorest
image quality and highest compression, while 100 gives the best quality and lowest compression.
As a result quality to compression ratio can be selected to meet different needs. JPEG committee
suggests matrix with quality level 50 as standard matrix. For obtaining quantization matrices with
other quality levels, scalar multiplications of standard quantization matrix are used. Quantization
is achieved by dividing transformed image matrix by the quantization matrix used. Values of the
resultant matrix are then rounded off. In the resultant matrix coefficients situated near the upper
left corner have lower frequencies .Human eye is more sensitive to lower frequencies .Higher
frequencies are discarded. Lower frequencies are used to reconstruct the image[18].

6.2. Entropy Encoding

After quantization, most of the high frequency coefficients are zeros. To exploit the number of
zeros, a zig-zag scan of the matrix is used yielding to long string of zeros.[18].

To evaluate the performance of the proposed scheme,[13] 2-D DCT is applied on Lena’s image
(352*352) as a test image. DCT is applied to lena’s image through scaling factor 2, scaling factor
4 and scaling factor 8, and observe the result. The results are then compared with various
compression methods. We used Peak Signal-to Noise Ratio (PSNR) and Mean Square Error
(MSE) for a compressed image. This ratio is often used as a quality measurement between the
original and compressed image.

To compute the PSNR, first calculate the mean-squared error using the following equation:




                                                                                                  47
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013
Where x (m, n) and y (m, n) are the two images of the size m*n. In this case x is the original
image and y is the compressed image




                                     Figure :3 Original image




                                    Figure :4 scaling factor=2




                                                                                           48
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013


                                      Figure : 5 scaling factor=4




                                      Figure : 6 scaling factor=8

                                    Table 1: Ratio of MSE & PSNR

                                      Scaling      Scaling      Scaling
                                      factor=2     factor=4     factor=8
                             MSE      48.6         43.3         39.0
                             PSNR     0.89         3.03         8.2

7. Conclusion

From the above experiments, high compression ratio and better image quality accomplished
which is better than existing methods. This paper has concentrated on development of efficient
and effective algorithm for still image compression. Fast and lossless compression algorithm
using 2-D DCT is developed. From the Results it is observed that the encoding time is reduced
with little degradation in image quality compare to anticipated method. Compression ratio is also
increased, while comparing the wished-for method with other methods. Our future work involves
improving image quality by increasing PSNR value and lowering MSE value.

References

[1]   Intoduction to Data compression by Khalid sayood, Third edition, (Morgan Kaufmann series in
      multimedia information and systems)
[2]   W. Yan, P. Hao, C. Xu, ”Matrix factorization for fast DCT algorithms”,IEEE International
      Conference on Acoustics, Speech, and Signal Processing, vol. 3, 2006.
[3]   http://vedyadhara.ignou.ac.in/wiki/images/5/58/B2U1mcs-053.pdf
[4]   Mathematical elements for computer graphics By David. F. Rogers, J.Alan Adams, McGraw-Hill
      Science/Engineering/Math; 2 edition (August 1, 1989)


                                                                                              49
Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013
[5]    Computer graphics-Donald Hearn, M. Pauline Baker, Prentice-Hall, 1986, University of Minnesota,
       20 Jan 2010
[6]    http://en.wikipedia.org/wiki/Data_compression
[7]    Andrew B. Watson, NASA Ames Research, “Image Compression Using the Discrete Cosine
       Transform”, Mathematica Journal, 4(1),1994, p. 81-88.
[8]    Nageswara Rao Thota, and Srinivasa         Kumar Devireddy, “Image Compression Using Discrete
       Cosine Transform”, GeorgianElectronic Scientific Journal: Computer                    Science and
       Telecommunications 2008|No.3(17).
[9]    Swastik Das and Rashmi Ranjan Sethy, “A Thesis on Image Compression using Discrete Cosine
       Transform and Discrete Wavelet Transform”, Guided By: Prof. R.                Baliarsingh, dept of
       Computer Science & Engineering, National Institute of Rourkela.
[10]   F. Feing, S. Winograd, “Fast algorithms for the discrete cosine transform”, IEEE Transactions on
       Signal Processing, vol. 40, no. 9,September, 1992.
[11]   N. Ahmed, T. Natarajan, and K.R. Rao,”Discrete Cosine Transform”, IEEE Trans. Computers, 90-93,
       Jan 1974.
[12]   Wallace, G. 1991. The JPEG still picture compression standard communications of the ACM 34(4):
       30-44.
[13]   Chih-chang chen, Oscal T-C. Chen “A Low complexity computation scheme of discrete cosine
       transform and quantization with adaptation to block content”, Dept of Electrical Engineering, 2000
       IEEE.
[14]   Chih-chang chen, Oscal T-C. Chen “signal and Media Laboratories”, Dept of Electrical Engineering,
       2000 IEEE.
[15]   Yung-Gi Wu, “Medical Image compression by sampling DCT coefficient”, 2002 IEEE.
[16]   V. Kober, “Fast algorithm for the computation of sliding discrete Hartley transform”, IEEE
       Transactions on Signal Processing, vol.55, Issue 6, pp.2937-2944, June,  2007.
[17]   Rafael C. Gonzalez and Richard E. Woods, “Digital Image Processing”, 2nd Edition, Pearson
       Education, ISBN-81-7808-629-8, 2002.
[18]   Ken cabeen and Peter Gent,"Image Compression and the Descrete Cosine Transform"Math
       45,College of the Redwoods.




                                                                                                      50

More Related Content

PDF
A STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUES
PDF
Ijcga1
PDF
Developing 3D Viewing Model from 2D Stereo Pair with its Occlusion Ratio
PDF
model interpolasi
PDF
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
PDF
Remotely Sensed Image (RSI) Analysis for feature extraction using Color map I...
PDF
Harries corner detector derived by local autocorrelation function (survey)
PDF
Wavelet-Based Warping Technique for Mobile Devices
A STUDY AND ANALYSIS OF DIFFERENT EDGE DETECTION TECHNIQUES
Ijcga1
Developing 3D Viewing Model from 2D Stereo Pair with its Occlusion Ratio
model interpolasi
STATE SPACE GENERATION FRAMEWORK BASED ON BINARY DECISION DIAGRAM FOR DISTRIB...
Remotely Sensed Image (RSI) Analysis for feature extraction using Color map I...
Harries corner detector derived by local autocorrelation function (survey)
Wavelet-Based Warping Technique for Mobile Devices

What's hot (18)

PDF
Image segmentation using normalized graph cut
PDF
Performance Comparison of Density Distribution and Sector mean of sal and cal...
PPT
Image segmentation
PDF
DidrikLilja-Assignment2-Report
PDF
Hsieh etal spl
PDF
Visualization of general defined space data
PPTX
3D Graphics & Rendering in Computer Graphics
PDF
Spme 2013 segmentation
PPS
Automatic Classification Satellite images for weather Monitoring
PPTX
PDF
FORGERY (COPY-MOVE) DETECTION IN DIGITAL IMAGES USING BLOCK METHOD
PPTX
Face Recognition using PCA-Principal Component Analysis using MATLAB
PPTX
Image recogonization
PDF
An efficient approach to wavelet image Denoising
PDF
ICVG : Practical Constructive Volume Geometry for Indirect Visualization
PDF
ICVG: PRACTICAL CONSTRUCTIVE VOLUME GEOMETRY FOR INDIRECT VISUALIZATION
PDF
PPT s10-machine vision-s2
PPTX
Computer graphics
Image segmentation using normalized graph cut
Performance Comparison of Density Distribution and Sector mean of sal and cal...
Image segmentation
DidrikLilja-Assignment2-Report
Hsieh etal spl
Visualization of general defined space data
3D Graphics & Rendering in Computer Graphics
Spme 2013 segmentation
Automatic Classification Satellite images for weather Monitoring
FORGERY (COPY-MOVE) DETECTION IN DIGITAL IMAGES USING BLOCK METHOD
Face Recognition using PCA-Principal Component Analysis using MATLAB
Image recogonization
An efficient approach to wavelet image Denoising
ICVG : Practical Constructive Volume Geometry for Indirect Visualization
ICVG: PRACTICAL CONSTRUCTIVE VOLUME GEOMETRY FOR INDIRECT VISUALIZATION
PPT s10-machine vision-s2
Computer graphics
Ad

Viewers also liked (8)

PPTX
TCI2012 New Approaches in Cluster Evaluation
PDF
heli trip_2011_FTA
PPSX
Steve jobs
PPTX
TCIOceania14 Building a successful cluster system in regional Australia
PPT
How to get followers fast on pinterest
PDF
TCI 2014 Management 3.0 Agile cluster management
PPTX
TCI 2015 Investing for a Creative Region
PPTX
тиждень бжд
TCI2012 New Approaches in Cluster Evaluation
heli trip_2011_FTA
Steve jobs
TCIOceania14 Building a successful cluster system in regional Australia
How to get followers fast on pinterest
TCI 2014 Management 3.0 Agile cluster management
TCI 2015 Investing for a Creative Region
тиждень бжд
Ad

Similar to Scaling Transform Methods For Compressing a 2D Graphical image (20)

PDF
Scaling Transform Methods For Compressing a 2D Graphical image
PDF
2.[9 17]comparative analysis between dct & dwt techniques of image compression
PDF
2.[9 17]comparative analysis between dct & dwt techniques of image compression
PPTX
Overview of Transformation in Computer Graphics
PPT
2 d transformations by amit kumar (maimt)
PPT
2D-Transformations-Transformations are the operations applied to geometrical ...
PDF
Unit-3 overview of transformations
PDF
H0545156
PPT
2 d geometric transformations
PDF
2 d transformations
PPT
06.Transformation.ppt
PDF
A Comparative Study of Image Compression Algorithms
PDF
COMPUTER GRAPHICS AND VISUALIZATION :MODULE-02 notes [BCG402-CG&V].pdf
PDF
2-D Transformations.pdf
PPT
2d transformation
PPT
Two dimensional_Transformations Notes.ppt
PPT
Matrix 2 d
PPTX
2hjsakhvchcvj hSKchvsABJChjSVCHjhvcvdxz.pptx
PDF
2D Transformation in Computer Graphics
DOC
Unit 3 notes
Scaling Transform Methods For Compressing a 2D Graphical image
2.[9 17]comparative analysis between dct & dwt techniques of image compression
2.[9 17]comparative analysis between dct & dwt techniques of image compression
Overview of Transformation in Computer Graphics
2 d transformations by amit kumar (maimt)
2D-Transformations-Transformations are the operations applied to geometrical ...
Unit-3 overview of transformations
H0545156
2 d geometric transformations
2 d transformations
06.Transformation.ppt
A Comparative Study of Image Compression Algorithms
COMPUTER GRAPHICS AND VISUALIZATION :MODULE-02 notes [BCG402-CG&V].pdf
2-D Transformations.pdf
2d transformation
Two dimensional_Transformations Notes.ppt
Matrix 2 d
2hjsakhvchcvj hSKchvsABJChjSVCHjhvcvdxz.pptx
2D Transformation in Computer Graphics
Unit 3 notes

More from acijjournal (20)

PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PDF
July 2025-Top 10 Read articles ACIJ Advanced Computing: An International Jour...
PDF
MODEL AND ALGORITHM FOR INCREASING THE EFFICIENCY OF REMOTE SERVICE SYSTEMS S...
PDF
15th International Conference on Computer Science, Engineering and Applicatio...
PDF
4th International Conference on Computer Science and Information Technology (...
PDF
APPLICATION AND ANALYSIS OF ENSEMBLE ALGORITHMS IN SOLVING REGRESSION PROBLEMS
PDF
4th International Conference on Computer Science and Information Technology (...
PDF
Application and Analysis of Ensemble Algorithms in Solving Regression Problems
PDF
17th International Conference on Networks & Communications (NeTCoM 2025)
PDF
METHODS AND ALGORITHMS FOR ASSESSING COMPUTER NETWORK PERFORMANCE
PDF
Advanced Computing: An International Journal (ACIJ)
PDF
6 th International Conference on Data Mining and Software Engineering (DMSE 2...
PDF
ARTICLE :OVERVIEW OF STRUCTURE FROM MOTION
PDF
14th International Conference on Advanced Information Technologies and Applic...
PDF
2nd International Conference on Information Technology Convergence Services &...
PDF
Advanced Computing: An International Journal ( ACIJ )
PDF
3rd International Conference on Computer Science, Engineering and Artificia...
PDF
6th International Conference on Big Data and Machine Learning (BDML 2025)
PDF
METHODS AND ALGORITHMS FOR ASSESSING COMPUTER NETWORK PERFORMANCE
PDF
4th International Conference on Computing and Information Technology Trends (...
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
July 2025-Top 10 Read articles ACIJ Advanced Computing: An International Jour...
MODEL AND ALGORITHM FOR INCREASING THE EFFICIENCY OF REMOTE SERVICE SYSTEMS S...
15th International Conference on Computer Science, Engineering and Applicatio...
4th International Conference on Computer Science and Information Technology (...
APPLICATION AND ANALYSIS OF ENSEMBLE ALGORITHMS IN SOLVING REGRESSION PROBLEMS
4th International Conference on Computer Science and Information Technology (...
Application and Analysis of Ensemble Algorithms in Solving Regression Problems
17th International Conference on Networks & Communications (NeTCoM 2025)
METHODS AND ALGORITHMS FOR ASSESSING COMPUTER NETWORK PERFORMANCE
Advanced Computing: An International Journal (ACIJ)
6 th International Conference on Data Mining and Software Engineering (DMSE 2...
ARTICLE :OVERVIEW OF STRUCTURE FROM MOTION
14th International Conference on Advanced Information Technologies and Applic...
2nd International Conference on Information Technology Convergence Services &...
Advanced Computing: An International Journal ( ACIJ )
3rd International Conference on Computer Science, Engineering and Artificia...
6th International Conference on Big Data and Machine Learning (BDML 2025)
METHODS AND ALGORITHMS FOR ASSESSING COMPUTER NETWORK PERFORMANCE
4th International Conference on Computing and Information Technology Trends (...

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Spectroscopy.pptx food analysis technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Cloud computing and distributed systems.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
NewMind AI Weekly Chronicles - August'25 Week I
Spectroscopy.pptx food analysis technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
“AI and Expert System Decision Support & Business Intelligence Systems”
Cloud computing and distributed systems.
Review of recent advances in non-invasive hemoglobin estimation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Advanced methodologies resolving dimensionality complications for autism neur...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Programs and apps: productivity, graphics, security and other tools
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Chapter 3 Spatial Domain Image Processing.pdf
Unlocking AI with Model Context Protocol (MCP)
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Scaling Transform Methods For Compressing a 2D Graphical image

  • 1. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 Scaling Transform Methods For Compressing a 2D Graphical image Ms. A. J. Rajeswari Joe Research Scholar, Bharathiyar University Assistant Professor, Department of MCA, GSS Jain College for Women, Chennai rajoes@yahoo.com Dr. N. Rama Research Supervisor, Bharathiyar University Assistant Professor, Department of Computer Science, Presidency College, Chennai ABSTRACT Transformation is a process of converting the original picture coordinates into a different picture coordinates either by adding some values with original coordinates(Translations) or Multiplying some values with original coordinates(called Linear transformations like rotation, reflection, scaling, and shearing). In this paper, we compress a two dimensional picture using 2D scaling transformation. In the several scenarios, the utilization of this technique for image compression resulted in comparable or better performance, when compared to the Different modes of image transformations. In this paper We tried a new code for compressing an 2d gray scale image using scaling transform methods. Matlab concepts are applied to compress the image. We have plan to apply The techniques and develop a code for compressing a 3d image. KEYWORDS Scaling factors (compression factors), two dimensional scaling transformation, decompression, experimental result,. 1. Introduction Scaling is the process of expanding or compressing the dimensions (i.e., size) of an object. An important application of scaling is in the development of viewing transformation, which is a mapping from a window used to clip the scene to a view port for displaying the clipped scene on the screen. In Euclidean geometry, changing the size of an object is called a scale. We scale an object by scaling the x and y coordinates of each vertex in the object uniform scaling (or isotropic scaling,) is a linear transformation that enlarges (increases) or shrinks (diminishes) objects by a scale factor that is the same in all directions. The result of uniform scaling is similar (in the DOI : 10.5121/acij.2013.4204 41
  • 2. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 geometric sense) to the original. A scale factor of 1 is normally allowed, so that congruent shapes are also classed as similar. More general is scaling with a separate scale factor for each axis direction. Non-uniform scaling (anisotropic scaling) is obtained when at least one of the scaling factors is different from the others; a special case is directional scaling or stretching (in one direction). Non-uniform scaling changes the shape of the object; e.g. a square may change into a rectangle, or into a parallelogram if the sides of the square are not parallel to the scaling axes (the angles between lines parallel to the axes are preserved, but not all angles). In this paper we have compressed lena’s image which is a grayscale 2d image using Matlab coding. 2-D Dimensional Cosine Transform is applied on Lena’s image (352*352) as a test image. DCT is applied to lena’s image through scaling factor 2, scaling factor 4 and scaling factor 8, and the result is analysed. The results are then compared with various compression methods. We used Peak Signal-to Noise Ratio (PSNR) and Mean Square Error (MSE) to observe the quality of the compressed image and original image. 2.Scaling factors(compression factors) A scaling transformation alters the size of an object. The operation is accomplished by multiplying each coordinate by scaling factors Sx, Sy . When (Sx Sy,) < 1 the object or image is compressed. Where Sx , Sy are the scaling factors along each axis with respect to the local coordinate system of the model. The scaling transformation allows a transformation matrix to change the dimensions of an object by shrinking or stretching along the major axes centered on the origin. It should be noted that the scaling is always about the origin along each dimension with the respective scaling factors. This means that if the object being scaled does not overlap the origin, it will move farther away if it is scaled up, and closer if it is scaled down. Scaling with respect to a selected fixed position (Sx Sy) can be represented with the following transformation sequence: 1. Translate the fixed point to the origin 2. Scale the object relative to the coordinate Origin 3. Translate the fixed point back to its original Position. 3. Two Dimensional Scaling Let Sx , Sy be the scale in the positive x and y directions respectively. Then the scaled vertex is given by If, Sx = Sy=S then it is said to be homogenous or uniform scaling[4] transformation that maintains relative proportions of the scaled objects. The Magnification factor is |s|. All points move s times away from the origin. If |s| < 1, all the points move towards the origin, or demagnetized. 42
  • 3. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 Fig1. Scaling the original picture with scale factors Sx=-1, Sy= 2 If Sx ≠ Sy then the scaling is called differential scaling. When either Sx or Sy equals to one, simplest differential scaling. 2-Dimensional scaling in the matrix form is given by In the case where Sx =Sy = k, scaling increases the area of any surface by a factor of k2 and the volume of any solid object by a factor of k3. Such a scaling changes the diameter of an object by a factor between the scale factors, the area by a factor between the smallest and the largest product of two scale factors, and the volume by the product of all two. We can represent a triangle, shown in matrix form, [5] using homogeneous coordinates of the vertices as : A0 0 1 B1 1 1 C5 2 1 By choosing the scaling factor s=1/2 The matrix of scaling for compressing an image is: ½ 0 0 (S(1/2,1/2) ) 0 ½ 0 0 0 1 Multiply original matrix coordinates with matrix of scaling results the coordinates of either compressed image or decompressed image based on the scaling factors selected. So the new coordinates A’B’C’ of the scaled triangle ABC can be found as: A0 0 1 ½ 0 0 A 0 0 1 B1 1 1 0 ½ 0 B ½ ½ 1 C5 2 1 0 0 1 C 5/2 1 1 43
  • 4. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 Thus, the new coordinates are A’=(0,0), B’=(1/2, 1/2), C’= (5/2, 1) Figure2: Object after scaling with Sx = Sy = 1/2 (Compressed picture) 4. Decompression The inverse scaling matrix[4] is obtained by replacing sx and sy with 1/sx and 1/sy. The scaling discussed so far has the origin (0,0) as the fixed point and scaling is about the origin. When an object is scaled, it is moved sx and sy times away from the origin. It is also possible to have any arbitrary point as a fixed point, and scale about that point. We can represent a triangle, shown in matrix form, using homogeneous coordinates of the vertices as : A0 0 1 B1 1 1 C5 2 1 choosing scaling factor s=2 The matrix of scaling for decompression is: 2 0 0 (S(2,2) ) 0 2 0 0 0 1 So the new coordinates A’B’C’ of the scaled triangle ABC can be found as: A0 0 1 2 0 0 A 0 0 1 B1 1 1 0 2 0 B 2 2 1 C5 2 1 0 0 1 C 10 4 1 44
  • 5. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 Thus, A’=(0,0), B’=(2,2), C’= (10, 4) The following figure (3) shows the effect of scaling with sx=sy =2. Figure2: Object after scaling with 1/sx and 1/sy. (i.e) Sx = Sy = 2 (DeCompressed picture) 5. Related Work 5.1 The Discrete Cosine Transform DCT Attempts to decorrelate the image data after decorrelation each transform coefficient can be encoded without dropping off compression efficiency[7]. DCT separates images into parts of different frequencies where less important frequencies are discarded through quantization and important frequencies are used to retrieve the image during decompression. Compared to other input dependent transforms, DCT has many advantages: (1) It has been implemented in single integrated circuit; (2) It has the ability to pack most information in fewest coefficients; (3) It minimizes the block like appearance called blocking artifact that results when boundaries between sub-images become visible 5.2 The One-Dimensional DCT The DCT of a list of n real numbers s(x), [8] where x=0, 1, ….., n-1, is the list of length n given by: For u= 0, 1, 2, … N-1. Similarly, the inverse transform is [5]defined as 45
  • 6. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 Thus, the first transform coefficient is the coefficient is the average value of the sample sequence 5.3 The Two-Dimensional DCT The Discrete Cosine Transform (DCT) is one of many transforms that takes its input and transforms it into a linear combination of weighted basis functions. These basis functions [11]are commonly the frequency. The 2-D Discrete Cosine Transform is just a one dimensional DCT applied twice, once in the x direction, and again in the y direction. One can imagine the computational complexity of doing so for a large image. Thus, many algorithms, such as the Fast Fourier Transform (FFT), have been created to speed the computation. The DCT computes the i, jth entry of the DCT of an image. N is the size of the block that the DCT is applied on. The equation [7]calculates one entry (i, jth) of the transformed image from the pixel values of the original image matrix. For the standard 8*8 block that JPEG compression uses, N equals * and x and y range from 0 to 7. Therefore D (I,j) would be as in equation: Because the DCT uses cosine functions, the resulting matrix depends on the horizontal and vertical frequencies. Therefore an image block with a lot of change in has a very random looking resulting matrix of a large value for the first element and zeroes for the other element. 6. Experimental Result • Original image is divided into blocks of 8 x 8. • Pixel values of a black and white image range from 0-255 but DCT is designed to work on pixel values ranging from -128 to 127 .Therefore each block is modified to work in the range. 46
  • 7. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 • DCT is applied to each block by multiplying the modified block with DCT matrix on the left and transpose of DCT matrix on its right. • Each block is then compressed through quantization. • Quantized matrix is then entropy encoded. • Compressed image is reconstructed through reverse process. • Inverse DCT is used for decompression. 6.1 Quantization Quantization is achieved by compressing a range of values to a single quantum value. When the number of discrete symbols in a given stream is reduced, the stream becomes more compressible. A quantization matrix is used in combination with a DCT coefficient matrix to carry out transformation. Quantization is the step where most of the compression takes place.DCT really does not compress the image because it is almost lossless. Quantization makes use of the fact that higher frequency components are less important than low frequency components. It allows varying levels of image compression and quality through selection of specific quantization matrices. Thus quality levels ranging from 1 to 100 can be selected, where 1 gives the poorest image quality and highest compression, while 100 gives the best quality and lowest compression. As a result quality to compression ratio can be selected to meet different needs. JPEG committee suggests matrix with quality level 50 as standard matrix. For obtaining quantization matrices with other quality levels, scalar multiplications of standard quantization matrix are used. Quantization is achieved by dividing transformed image matrix by the quantization matrix used. Values of the resultant matrix are then rounded off. In the resultant matrix coefficients situated near the upper left corner have lower frequencies .Human eye is more sensitive to lower frequencies .Higher frequencies are discarded. Lower frequencies are used to reconstruct the image[18]. 6.2. Entropy Encoding After quantization, most of the high frequency coefficients are zeros. To exploit the number of zeros, a zig-zag scan of the matrix is used yielding to long string of zeros.[18]. To evaluate the performance of the proposed scheme,[13] 2-D DCT is applied on Lena’s image (352*352) as a test image. DCT is applied to lena’s image through scaling factor 2, scaling factor 4 and scaling factor 8, and observe the result. The results are then compared with various compression methods. We used Peak Signal-to Noise Ratio (PSNR) and Mean Square Error (MSE) for a compressed image. This ratio is often used as a quality measurement between the original and compressed image. To compute the PSNR, first calculate the mean-squared error using the following equation: 47
  • 8. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 Where x (m, n) and y (m, n) are the two images of the size m*n. In this case x is the original image and y is the compressed image Figure :3 Original image Figure :4 scaling factor=2 48
  • 9. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 Figure : 5 scaling factor=4 Figure : 6 scaling factor=8 Table 1: Ratio of MSE & PSNR Scaling Scaling Scaling factor=2 factor=4 factor=8 MSE 48.6 43.3 39.0 PSNR 0.89 3.03 8.2 7. Conclusion From the above experiments, high compression ratio and better image quality accomplished which is better than existing methods. This paper has concentrated on development of efficient and effective algorithm for still image compression. Fast and lossless compression algorithm using 2-D DCT is developed. From the Results it is observed that the encoding time is reduced with little degradation in image quality compare to anticipated method. Compression ratio is also increased, while comparing the wished-for method with other methods. Our future work involves improving image quality by increasing PSNR value and lowering MSE value. References [1] Intoduction to Data compression by Khalid sayood, Third edition, (Morgan Kaufmann series in multimedia information and systems) [2] W. Yan, P. Hao, C. Xu, ”Matrix factorization for fast DCT algorithms”,IEEE International Conference on Acoustics, Speech, and Signal Processing, vol. 3, 2006. [3] http://vedyadhara.ignou.ac.in/wiki/images/5/58/B2U1mcs-053.pdf [4] Mathematical elements for computer graphics By David. F. Rogers, J.Alan Adams, McGraw-Hill Science/Engineering/Math; 2 edition (August 1, 1989) 49
  • 10. Advanced Computing: An International Journal ( ACIJ ), Vol.4, No.2, March 2013 [5] Computer graphics-Donald Hearn, M. Pauline Baker, Prentice-Hall, 1986, University of Minnesota, 20 Jan 2010 [6] http://en.wikipedia.org/wiki/Data_compression [7] Andrew B. Watson, NASA Ames Research, “Image Compression Using the Discrete Cosine Transform”, Mathematica Journal, 4(1),1994, p. 81-88. [8] Nageswara Rao Thota, and Srinivasa Kumar Devireddy, “Image Compression Using Discrete Cosine Transform”, GeorgianElectronic Scientific Journal: Computer Science and Telecommunications 2008|No.3(17). [9] Swastik Das and Rashmi Ranjan Sethy, “A Thesis on Image Compression using Discrete Cosine Transform and Discrete Wavelet Transform”, Guided By: Prof. R. Baliarsingh, dept of Computer Science & Engineering, National Institute of Rourkela. [10] F. Feing, S. Winograd, “Fast algorithms for the discrete cosine transform”, IEEE Transactions on Signal Processing, vol. 40, no. 9,September, 1992. [11] N. Ahmed, T. Natarajan, and K.R. Rao,”Discrete Cosine Transform”, IEEE Trans. Computers, 90-93, Jan 1974. [12] Wallace, G. 1991. The JPEG still picture compression standard communications of the ACM 34(4): 30-44. [13] Chih-chang chen, Oscal T-C. Chen “A Low complexity computation scheme of discrete cosine transform and quantization with adaptation to block content”, Dept of Electrical Engineering, 2000 IEEE. [14] Chih-chang chen, Oscal T-C. Chen “signal and Media Laboratories”, Dept of Electrical Engineering, 2000 IEEE. [15] Yung-Gi Wu, “Medical Image compression by sampling DCT coefficient”, 2002 IEEE. [16] V. Kober, “Fast algorithm for the computation of sliding discrete Hartley transform”, IEEE Transactions on Signal Processing, vol.55, Issue 6, pp.2937-2944, June, 2007. [17] Rafael C. Gonzalez and Richard E. Woods, “Digital Image Processing”, 2nd Edition, Pearson Education, ISBN-81-7808-629-8, 2002. [18] Ken cabeen and Peter Gent,"Image Compression and the Descrete Cosine Transform"Math 45,College of the Redwoods. 50