# Data Compression with a Time Limit
## 3 Lossless Compression
### Lossless Compression of Two-Dimensional Data with a Time Limit
#### 3.2.1 Compression of a Set of Animated Images with Similar Scenes  
The dataset \(D\) to be compressed consisted of 1000 images, for a total size of 659 MB (691,744,000 bytes). Single runs of the compression tools yielded the following pairs (\(b_{i}\), \(t_{i}\)).  
Table 3 shows us that the fastest compressor was BMP while the slowest was JPEG2000. From the point of view of the compression obtained, the best compressor was JPEG-LS, while the worst was BMP.  
\begin{table}
\begin{tabular}{c c c} \hline
**Tool** & **Download** & **Configuration** \\ \hline PNG & [[https://www.idrsolutions.com/jdeli](https://www.idrsolutions.com/jdeli)]([https://www.idrsolutions.com/jdeli](https://www.idrsolutions.com/jdeli)) & Lossless \\ TIFF & [[https://www.idrsolutions.com/jdeli](https://www.idrsolutions.com/jdeli)]([https://www.idrsolutions.com/jdeli](https://www.idrsolutions.com/jdeli)) & Deflate \\ JPEG-LS & [[http://www.labs.hp.com/research/info](http://www.labs.hp.com/research/info)]([http://www.labs.hp.com/research/info](http://www.labs.hp.com/research/info))\_theory/ & Lossless 8 bits \\  & loco/locodownold.html & \\ JPEG2000 & [[http://www.dclunie.com/jj2000/JPEG%202000](http://www.dclunie.com/jj2000/JPEG%202000)]([http://www.dclunie.com/jj2000/JPEG%202000](http://www.dclunie.com/jj2000/JPEG%202000))\%2 & Lossless \\  & 0 implementation\%20 in\%20]ava.html & Compression with uncompressed pixel \\ BMP & [[https://github.com/jaí-imageio/jai-imageio-core](https://github.com/jaí-imageio/jai-imageio-core)]([https://github.com/jaí-imageio/jai-imageio-core](https://github.com/jaí-imageio/jai-imageio-core)) & map (BI RGB) \\ FELICS & Java implementation & Lossless 8 bits \\ \hline \end{tabular}
\end{table}
Table 2: Compression tools.  
\begin{table}
\begin{tabular}{c c c} \hline
**Tool** & **Size of Output in Bytes** & **Compression Time in ms.** \\ \hline PNG & 183,362,330 & 70,806 \\ TIFF & 169,626,226 & 91,082 \\ JPEG-LS & 129,232,679 & 116,263 \\ JPEG2000 & 145,893,942 & 564,370 \\ BMP & 691,254,004 & 37,975 \\ FELICS & 201,865,197 & 42,952 \\ \hline \end{tabular}
\end{table}
Table 3: Animated images with similar scenes.  
The _useful-setup_ is therefore composed of the compressors BMP, FELICS, PNG, TIFF, and JPEG-LS. With an assigned time budget \(t_{1}\) = 39,000 ms then the optimal mix is given by the mix of the BMP and FELICS setups, and it is closer to the BMP setup. All this is shown in Figure 1:  
In this case, the optimum is perfectly intersected with the convex hull. A total of 794 images will be compressed using BMP, the other 206 with FELICS. We therefore compressed \(D\) as suggested by the algorithm: the compression time was 39,141 ms and the output size 563 MB (590,397,633 bytes).  
For \(t_{2}\) = 89,000 ms, instead, the optimal mix is given by the mix between the TIFF and PNG configurations, and it is very close to the TIFF configuration. Figure 2 shows it:  
Figure 1: Optimal mix, t = 39,000 ms.  
Figure 2: Optimal mix, t = 89,000 ms.  
Here too, the optimum intersects the convex hull. The number of images to compress with TIFF was 897, while for PNG it was 103.  
The compression time was 89,546 ms., while the output size was 163 MB (170,978,001 bytes).