Visual Quality Increasing using Image Parts Improvement for Fractal Image Compression Dmitriy Vatolin Moscow State University dm@amc amc.ru
Introduction New compression methods with loosing of information: JPEG based methods Wavelet compression Fractal image compression Fractal image compression method with lost of information, that appear in 1992. 2
Idea of the method (1) Compression method searching for similar regions with other size. 3
4 Idea of the method (2) Idea of the method (2) w õ w x y z a b c d p x y z e f q i i ( ) = = + 0 0 0 0 Affine transform is used for transformation. Affine transform is used for transformation.
Idea of the method (3) w õ i ( ) Iterated Function System (IFS) Collage Theorem theory tells that using only coefficients we can get the original image. Coefficients are saved to file If the size (in bytes) of coefficients is smaller than the size of the original image we have a compression algorithm 5
Decompression One iteration: Original image Transforms New image 6
Selecting method: Idea Main idea: Increase quality only in selected areas. Hi rate compressed image Increased quality areas 7
Selecting method: Problem Bad area Transforms Quality degradation Quality degradation on the decompression stage 8
Selecting method: In short Original method: Set of blocks Search for Best transforms Select qtree best pairs nodes New method: Mask image Set of blocks Search for best pairs List of ordered transforms Select qtree nodes Make evaluation image & select best 9
Original method Step 1. Pre-calculation for (all range blocks) { dist ij = MaximumDistance; R ij = image->copyblock CopyBlock(i,j); } Step 2. Searching for a best blocks for (all range blocks) { for (all domain blocks) { current= current coordinates; D=image->CopyBlock CopyBlock(current); current_dist=r ij.l2dist (D); if(current_dist < dist ij ) { dist ij = current_dist; best ij = current; } } } Save_All All_Best_To_Fractal_File(best); 10
Selected method: Compression Changes in the algorithm: Step 2. Searching for a best blocks for (all range blocks) { for (all domain blocks) { current= current coordinates; D=image->CopyBlock CopyBlock(current); current_dist=r ij.l2dist (D); Insert(best ij, current, current_dist dist); } } } // Prepare evaluation image. for (all best ij ) { Fill in evaluation image block with brightness, depends on best distance of this block } // Other levels of qtree for (all best ij ) { for (all transformations in best ij ) select best transformation } Save_All_Best_To_Fractal_File(best); 11
Selected method: Decompression Decompression does not changed in this approach! 12
Original images Original method Mask image 13
Decompressed images Original method New method 14
Creation of evaluation images Two ways: 1) Faster: Use block L 2 distances for average block as accuracy. 2) Better quality: Use full image decompression and pixel differences. 15
Evaluation images (distance) Original method New method 16
Evaluation images (differences) Original method Our method 17
Zoomed images Original method Our method 18
Results: Quality increasing (1) 37.991 30 37.902 PSNR, db PSNR, db 37.813 37.724 29.5 0 2 4 6 8 37.635 0 2 4 6 8 Compression speed Old method New method Compression speed Old method New method Image quality increasing for Barbara & Dmc images. 19
Results: Quality increasing (2) max_y 36 34 PSNR, db v v2 32 min_y 30 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 int File size parameter Old method New method Image quality increasing for Barbara from compression rate max_x 20
Results: Block selecting (1) Number of blocks f f2 f3 f4 1.1 0 1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 2 4 0.5 int, int 1 level, 42 blocks 2 level, 439 blocks 3 level, 661 blocks 4 level, 2602 blocks 4.5 Frequency distribution of block number in ordered lists for fast and slow compression of Barbara image (7 times compression rate) Number of blocks 1.1 1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0 2 4 1 level, 43 blocks 2 level, 447 blocks 3 level, 720 blocks 4 level, 2540 blocks 21
Results: Block selecting (2) 1 Number of blocks 0 0 1 2 3 4 100 times rate, slow 40 times rate, slow 100 times rate, fast 40 times rate, fast Frequency distribution of block number in ordered lists for fast and slow compression of Dmc image (40 & 100 times compression rate) 22
Example (1) Very bad area for compression -- non sharp but important area 40 times old compression 40 times compression using areas Peresl.bmp 320x512 491576 bytes 40 times compression using areas Original 23
Example (2) Original 63 times compression old 63 times compression using areas Florian.bmp 384x608 700472 bytes 65 times compression JPEG 24
Example: Color photo dm (1) Original image (307Kb) Rate 40 times (7.67) Used 320x320 True Color (24 bits per pixel) image 25
Example: Color photo dm (2) Original image (307Kb) Rate 100 times (3.02Kb) 26
Compare with JPEG JPEG: Rate 100 times (3.06Kb) FIF: Rate 100 times (3.02Kb) 27
Conclusion & Future Work We increase image quality (without mask!) We increase average compression rate Future work: Automatic mask construction Iterated block selection 28
References [1] A.E. Jacquin.. Image coding based on a fractal theory of iterated contractive image transformations. // IEEE Trans. Image Processing 1 18-30, 1992; [2] Y. Fisher.. Fractal image compression with quadtrees.. In: Fractal Image Compression Theory and Application to Digital Images. Y. Fisher (ed.). Springer-Verlag Verlag,, New York 1994; [3] E. Reusens,, Partitioning complexity issue for Iterated Function Systems based image coding, in Proc. of VII European Signal Processing Conference, Vol. 1, Edinburg,, U.K., September 1994, pp. 171-174 174 [4] Y. Fisher, S. Menlove,, Fractal encoding with HV partitions, in [2]; [5] F. Davoine,, M. Antonini,, J.-M. Chassery,, M. Barlaud, Fractal image compression based on Delaunay triangulation and vector quantization, in Proc. of IEEE Transaction on Image Procession, P Vol. 5, No. 2, February 1996; [6] F. Davoine,, J. Svensson,, J.-M. Chassery, A mixed triangular and quadrilateral partition for fractal image coding, in Proc. of IEEE International Conference on Image Processing, Washington, D.C, 1995; [7] L. Thomas, F. Deravi, Region-based fractal image compression using heuristic search,, in Proc. of IEEE Transaction on Image Procession, Vol. 4, No. 6, June 1995, pp. 8328 32-838; [8] D. Saupe,, H. Hartenstein, Evolutionary fractal image compression, in Proc.. of IEEE International Conference on Image Processing, Laussane,, September 1996, pp.. 129-132; 132; [9] M. Ruhl,, H. Hartenstein,, D. Saupe, Adaptive partitioning for fractal image compression,, in Proc.. of IEEE International Conference on Image Processing, Santa Barbara, October 1997; [10] D. Saupe,, M. Ruhl,, R. Hamzaoui,, L. Grandi,, D. Marini, Optimal hierarchical partitions for fractal image compression,, in Proc.. of IEEE International Conference on Image Processing, Chicago, October 1998; [11] Д.С. Ватолин.. Гибридная схема фрактальной компрессии и квантования векторов для малых блоков.. // Материалы Graphicon-98, 1998; [12] Д.С. Ватолин. Использование ДКП для ускорения фрактального сжатия изображений.. // Программирование, N 4 1999. 29
Сравнение с другими алгоритмами (1) Алгоритм За счет чего происходит сжатие RLE 2 2 2 2 2 2 2 15 15 15 Подряд идущие цвета LZW 2 3 15 40 2 3 15 40 Одинаковые подцепочки Хаффмана 2 2 3 2 2 4 3 2 2 2 4 Разная частота появления цвета Wavelet Плавные переходы цветов и отсутствие резких границ JPEG Отсутствие резких границ Фрактальный Подобие между элементами изображения 30
Сравнение с другими алгоритмами (2) Алгоритм К-ты сжатия Симметричность На что ориентирован Потери Размерность RLE 1/32 1/2 2/1 1 3-8 bit Нет 1D LZW 1/1000 1/4 7/5 1.2-3 1-8 bit Нет 1D Haffman 1/8 2/3 1/1 1-1.5 5-8 bit Нет 1D JBIG 1.5 ~1 1-bit. Нет 2D Lossless JPEG 2 ~1 24-bit greyscale JPEG 2-20 ~1 24-bits greyscale Wavelet 2-200 1.5 24-bits greyscale Fractal 2-2000 1000-24-bits 10000 greyscale Нет Да Да Да 2D 2D 2D 2D 31