A New Lossy Image Compression Technique Using DCT, Round Variable Method & Run Length Encoding

Download Full-Text PDF Cite this Publication

Text Only Version

A New Lossy Image Compression Technique Using DCT, Round Variable Method & Run Length Encoding

Nitesh Agarwal1

Department of Computer Science Jodhpur Institute of Engineering & Technology

Jodhpur, India

Dr. Sandeep Mathur2

Department of Mathematics

Jodhpur Institute of Engineering & Technology Jodhpur, India

Dr. Anjali Mathur3

Department of Mathematics

Jodhpur Institute of Engineering & Technology Jodhpur, India

AbstractAn Image have important roles in human being life, it is used to store our memorable movement, used to represent a thing , used for communication purpose, even in video processing system it has important role because each frame of a video is made of an image. A high-quality image may require 10 to 100 million bits for representation. For example, a nearly photographic image requires approximately 1,280 rows of 800 pixels each, with 24 bits of color information per pixel, that is, a total of 24,576,000 bits, or 3,072,000 bytes. The large data files associated with images thus drive the need for extremely high compression ratios to make storage (particularly of movies) practical. Image compression process use two technique to compress image lossless image compression & lossy image compression. Images that provide numerical, Secure & financial information compressed using lossless image compression because we required original data back after decompression process. Lossless image compression use some entropy encoding technique but its compression ratio is low w.r.t lossy image compression. This paper describe a new lossy image compression technique by introducing an extra module named as Round Variable Method (RVM) in lossy image compression process This paper deals with comparative study of a compressed image on the basis of different value of round variable used in RVM.

Key Words: RVM, DCT, RLE, MSE, PSNR.

1. INTRODUCTION

Digital devices & computational resources have limited communication & storage capabilities for example without

compression, a CD with a storage capacity of approximately 600 million bytes only. Hence we need to compress image data for storing purpose as well as for communication over a network for example if there is a video conference organize by an organization which has a low bandwidth of a network, if image quality high for each frame of a video then it is difficult to deliver idea by video using low bandwidth over network provided by organization, hence organization need some image compression technique by which it compress the video before communication to provide a good communication in synchronize manner. Image compression process use two technique to compress image lossless image compression & lossy image compression. Images that provide numerical, Secure & financial information compressed using lossless image compression because we required original data back after decompression process. Lossless image compression use some entropy encoding technique but its compression ratio is low w.r.t lossy image compression. But other images like multimedia images can be compressed using lossy image compression. Lossy image compression require some transformation, quantization & entropy encodings to compress an image. Normally lossy image compression is process as follow

Because the human eye is very tolerant of approximation error in an image. Hence we may decide to exploit this tolerance to produce increased compression, at the expense of image quality by reducing some pixel data or information using this idea this

1 for v 0

N

N

(v) 4

paper introduce a new module named as RVM before entropy encoding techniques. In this paper RLE is used for encoding & RLE can compressed an image only if input values repeated at least for three times sequentially. Fig 2 describe the complete

2

N

1.2 Quantization

for v 0

lossy image compression using RVM method.

A Quantizer simply reduces the number of bits needed to store the transformed coefficients by reducing the precision of those values. Since this is a many-to-one mapping, its a lossy process and is the main source of compression in an encoder.

The quantization matrix is designed to provide more resolution to more perceivable frequency components over less perceivable components (usually lower frequencies over high frequencies) in addition to transforming as many components to 0, which can be encoded with greatest efficiency. A DCT block is quantize using following formula

DCT (i, j)

QDCTi, j ROUND 5

QT (i, j)

This lossy image compression mostly based on a transformation DCT (Discrete Cosine Transform), quantization of transform value using standard quantization table, RVM method & Run Length Encoding (RLE).

1.1 DCT (Discrete Cosine Transform) [1]

DCT convert an image into its equivalent frequency domain by partitioning image pixel matrix into blocks of size N*N. An image is a 2D pixel matrix hence 2D DCT is used to transform an image.

2-D DCT can be defined as

N 1 N 1 2x 1u 2y 1v

& this QDCT block dequantize by following formula DCTi, j ROUND QDCT(i, j) *QT(i, j) 6 For i, j= 0, 1, 2, 3.,N-1

Where (i,t) define position of input & output value, QDCT is DCT block after quantization, QT is standard quantization matrices & defined as

Cu,vu (v) f x, ycos cos

x0 y 0 2N 2N

for u, v = 0,1,2,,N 1.

& inverse transformation is defined as

1

16

11

10

16

24

40

51

61

12

12

14

19

26

58

60

55

14

13

16

24

40

57

69

56

14

17

22

29

51

87

80

62

18

22

37

56

68

109

103

77

24

35

55

64

81

104

113

92

49

64

78

87

103

121

120

101

72

92

95

98

112

100

103

99

16

11

10

16

24

40

51

61

12

12

14

19

26

58

60

55

14

13

16

24

40

57

69

56

14

17

22

29

51

87

80

62

18

22

3

56

68

109

103

77

24

35

55

64

81

104

113

92

49

64

78

87

103

121

120

101

72

92

95

98

112

100

103

99

N 1 N 1 2x 1u 2y 1v

f x, y u(v)cu,vcos

u 0 v0

cos

2N 2N

2

Where Cu, v represents frequency value for u, v &

f x, y represents pixel color value at position ( x, y ).

1 for u 0

Table 1: Quantization Matrices [9]

In this lossy image compression QDCT provides input for RVM method.

(u)

N 3

2 for u 0

    1. RVM (Random Variable Method)

      N RVM take inputs from quantize block & round the input value according to its variable for ex RVM has input as 101,102,103,104,105,106,107,108,109,110 & variable used in

      RVM is 5 then it round the each input value as 100,100,100,105,105,105,105,110,110,110 the reason behind

      to use this method before encoding is that an entropy encoding technique gives a high compression as the input values have repeated data sequentially. & it work as

      QDCT(i, j)

      1. Apply eq (5) on each block of DCT to get QDCT block.

      2. Apply eq (7) on each block of QDCT to get RVM block.

        RVM i, j ROUND

        7

        X

      3. Combine each RVM block & apply RLE on combine block & store this encoded block on secondary storage.

        & its inverse work as

        QDCTi, j ROUND RVM (i, j) * X 8

        Where X is variable used in RVM method [10].

    2. RLE (Run Length Encoding) [12]

This is a very simple compression technique method used for compressing sequential data. Many digital image consist pixel values that are repeats sequentially for such type of image RLE is useful. In proposed method RLE receive sequential data from RVM block & store input value that repeats & no of time that input value repeat sequentially. For ex. RVM block has data as

0

0

0

1

6

6

2

2

1

1

1

1

5

8

8

8

  1. To get Original image read RLE block from secondary storage & decode it to get combine RVM block & divide it into 8*8 small RVM block

  2. Apply eq (8) on each RVM block to get QDCT blocks.

  3. To get DCT blocks apply eq (6) on each QDCT block.

  4. Apply eq (2) on each DCT block to get IDCT blocks.

  5. Combine all IDCT blocks to get pixel matrix.

  6. Using pixel matrix we get required image.

  7. Now we Find MSE (Mean Squared Error), PSNR (Peak Signal To Noise Ratio) & CR (Compression Ration) to determine quality of image obtain by proposed method for each X variable used in RVM method. MSEX, PSNRX & CRX calculated by following formulas [11] –

MSE [O(x, y)M (x, y)]2

MSE [O(x, y)M (x, y)]2

H 1 W 1

1

X x 9

H * W x 0 y 0

PSNRx=20*log10 (MAX) – 10*log10 (MSEx) (10)

Fig 3: Pixel matrix of size 4*4

CRX

Original Im age size

To store above 4*4 RVM block total 16 values are required to store but after applying RLE only 12 values are required to store such as

Output Im age size 11

Where H=Height of Image, W= Width of Image, variable MAX shows max value of a pixel for example here image is 8 bit hence MAX=255, MSEx, PSNRx & CRx is MSE, PSNR & CR at variable X

Quality oufseimd aingeRoVbMtainmbeythpordo.posed method is depend on MSE & PSNR

decreases then we get a bad quality of image by proposed methodx & if as thxe vMalSuEe.vIafluaesdethcereaMseSsEPSvNalRuevainlucereianscerseaPsSesNwRe vgaeltuae

batter quality image hence on basis of this MSE proposed method gives

0

3

6

2

2

2

1

4

5

1

8

3

0

3

6

2

2

2

1

4

5

1

8

3

compressed image with best quality.

x & PSNRx value

Fig 4: matrix After RLE

2. MAIN RESULTS

2.2 Outputs

a best value of X on which we get a high

    1. Implementation of Proposed Lossy Image Compression

      This paper describe how a b/w (8 bit) image compressed using proposed method

      Steps involved in this implementation

      1. Create pixel matrix of the image & divided it into blocks of size 8*8

      2. Apply FDCT (Forward Discrete Sine Transform) on each 8*8 block of pixel matrix to get equivalent 8*8 DCT blocks using eq (1).

            1. Image Compression without RVM method

              Proposed Image

              Compression without RVM

              Fig 5: Uncompressed Image Size= 768 KB

              Fig 6: Compressed Image

              Size= 103 KB

              MSE

              PSNR

              CR

              Image Compression without RVM

              17

              36

              7

              X

              MSEX

              PSNRX

              CRX

              1

              17

              36

              7

              2

              41

              32

              11

              3

              38

              32

              14

              4

              54

              31

              16

              5

              61

              30

              19

              6

              80

              29

              24

              7

              87

              29

              24

              8

              107

              28

              24

              9

              121

              27

              32

              10

              138

              27

              32

              11

              153

              26

              32

              X

              MSEX

              PSNRX

              CRX

              1

              17

              36

              7

              2

              41

              32

              11

              3

              38

              32

              14

              4

              54

              31

              16

              5

              61

              30

              19

              6

              80

              29

              24

              7

              87

              29

              24

              8

              107

              28

              24

              9

              121

              27

              32

              10

              138

              27

              32

              11

              153

              26

              32

              Table 2: MSE, PSNR, CR without RVM

            2. Image Compression with proposed method

              X=1

              Size=103 KB

              X=2

              Size=72 KB

              X=3

              X=4

              Size=56 KB

              Table 3: MSEx, PSNRx, CRx on different value of X

              1. Graphs

                1. RVM variable X vs. CRx

                  Size=768 KB Size=48 KB

                  Uncompressed Image

                  X=5

                  X=6

                  X=7

                  Size=40 KB

                  Size=32 KB

                  Fig 8: Variation in CRx with different value of RVM variable X

                2. RVM variable X vs. MSEx

                  Size=32 KB Compressed Images

                  Fig 7: Proposed Lossy Image Compression with variation in RVM Variable X

                  Fig 9: Variation in MSEx with different value of RVM

                  variable X

                3. RVM variable X vs. PSNRx

                  Fig 10: Variation in PSNRx with different value of RVM variable X

                4. RVM variable X vs. PSNRx & MSEx

                  Fig 11: Variation in PSNRx & MSEx with different value of RVM variable X

                5. MSEx vs. PSNRx

        Fig 12: Graphical comparison between MSEx & PSNRx

      3. CONCLUSION

The result presented in this document shows that

  1. The results shows that as the value of variable X increases storage size of image decreases as shown in Fig 7.

  2. As the value of X increases CRx also increases as shown in Fig 8.

  3. As the value of X increases proposed process add more noises in the image i.e. value of MSEx increases as shown in Fig 9.

  4. As the value of X increases PSNRx value decreases as shown in Fig 10.

  5. As the MSEx value decreases & PSNRx increases quality of image improves but CRx decreases.

  6. Fig 11 show that for value 2 & 3 of variable X we get good quality of compressed image.

  7. Fig 11 shows that after the value 3 of variable X difference between MSEx & PSNRx increases as the value of variable X increases i.e more noises is added to the image.

  8. Fig 12 shows that as the value of MSEx increases value of PSNRx variable decrease i.e. quality of image decreases.

REFERENCES

  1. N.Ahmed, T.Natatarajan, and K.R. Rao, Discrete Cosine Transform, IEEE Transactions on Computers, vol. C-32,

    pp. 90-93, Jan. 1974.

  2. Andrew B. Watson, Image Compression Using Discrete Cosine Transform, NASA Ames Research Centre, 4(1),

    pp. 81-88,1994

  3. Harley R. Myler and Arthur R. Weeks The Pocket Handbook of Image Processing Algorithms in C, ISBN

    0-13-642240-3 Prentice Hall P T R Englewood Cliffs, New Jercy 07632.

  4. Malini. S & Moni. R.S Use of Discrete Sine Transform for A Noval Image Denoising Technique.

  5. R.C.Gonzalez, R.E.Woods, Digital Image Processing

    Pearson, 3rd Edition, India, 2009.

  6. Anjali Kapoor and Dr. Renu Dhir, Image Compression Using Fast 2-D DCT Technique, International Journal on

    Computer Science and Engineering (IJCSE), vol. 3 pp. 2415-2419, 6 June 2011

  7. Nitesh Agarwal and Dr. A.M. Khan Application of DCT in image processing, International Journal of

    Engineering Research & Technology (IJERT), ISSN: 2278-0181, pp. 185-189, 2014.

  8. Harley R. Myler and Arthur R. Weeks The Pocket Handbook of Image Processing Algorithms in C, ISBN

    0-13-642240-3 Prentice Hall P T R Englewood Cliffs , New Jercy 07632

  9. Jesse D. Kornblum Using JPEG quantization tables to identify imagery processed by software, ELSEVIER,

    DIGITAL INVESTIGATION 5, pp. S21-S25,2008.

  10. Firas A. Jassim and Hind E. Qassim, FIVE MODULUS METHOD FOR IMAGE COMPRESSION, signal & image processing: An International Journal (SIPIJ), vol 3, no.5, pp. 19-28, Octobar 2012

  11. A.M. Raid, W.M. khedr, M.A. El-dosuky and wesan Ahmed JPEG image compression using Discrete Cosine

    Transform A survey, International Journal of Computer Science & Engineering Survey (IJCSES), vol 5, no 2, pp. 29-47, April 2014.

  12. Asha Lata & Permender singh Review of Image Compression Techniques, International Journal of

    Emerging Technology & Advanced Engineering (IJETAE), vol 3, issue 7, pp. 461-464, July 2013.

  13. Swati Dhamija and Priyanka Jain Comparative Analysis for Discrete Sine Transform as a suitable method for noise estimation IJCSI International Journal of Computer Science Issues, Vol. 8, Issue 5, No 3, September 2011 pp. 162-164.

  14. Maneesha Gupta and Dr.Amit Kumar Garg, Analysis Of Image Compression Algorithm Using DCT International

    Journal of Engineering Research and Applications (IJERA), vol.2, pp. 515-521, Jan-Feb 2012

  15. Iain E.G. Richardson H.264 and MPEG-4 Video Compression: Video Coding for Next-generation Multimedia, ISBN 0470848375, 9780470848371, Wiley,2003.

Leave a Reply

Your email address will not be published. Required fields are marked *