# A New Way to Store Simple Text Files
## 3 Analysis And Discussions
### Case Study  
The proposed method converts any text file encoded using extended ASCII or UTF-8 format to the _png_ file format. Thus, different formats are reduced to one. In fact, this effect can be seen as desirable when viewed from the point of large volume data sets. The following files were selected for processing using the proposed method-as well as for further analysis:  
1. data1.txt: a text file containing some English text encoded in extended ASCII
2. data2.txt: a text file containing some Polish text encoded in UTF-8
3. data3.txt: a text file containing \(10^{6}\) random digits
4. data4.json: a text file in the format _json_ containing the code of the _.ipynb_ version of _python.py_ file
5. python.py: Python file which content is the source code published on Github platform
6. latex.tex: the file containing the latex source code of this article All of the presented algorithms have been implemented in the Python programming language. The source code responsible for the conversion (file with text content into a graphic format) has been shown on the Github platform. The URL to the source code repository can be found in Appendix A. The analysis of the time of changing the text format into an image in the _png_ format was made on a personal computer with:  
A Microsoft Windows 10 equipped with an Intel(R) Core(TM) i7-8565U CPU and 16 GB of RAM;  
B Linux Ubuntu 18.04.4 LTS equipped with Intel(R) Core(TM) 2 Duo T7200 CPU and 2 GB of RAM;  
C MacOS Catalina 10.15.3 equipped with Intel(R) i7-3667U CPU and 8 GB of RAM. Figures 2 and 3 show the results of application of proposed method in variant 1 (extended ASCII coding) and variant 2 (UTF-8 coding) for test file _data1.txt_. The smaller the \(CR\) value, the less disk space the compressed file takes. The results for selected files with different extensions are provided in the Tables 1 and 2. The resulting values show that the corresponding \(png\) images have significantly smaller sizes (in the case of extended ASCII files and most test files in UTF-8 coding), which means savings in the necessary disk space. This is due to the way the \(png\) format works, i.e., the content is lossless compressed. As it can be noticed, the results obtained are worse than for other compression methods (see Table 3). However, in the case of the _data3.txt_ test file, which consists of digits only, the CR compression value does not reflect that much. This case of the test file is similar in construction to Big Data. Nevertheless, those compression methods do not allow to hide the content of the file, which is discussed in Section 3.5. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**File** & **Text File Size (B)** & **PC** & _png Size (B)_ & **CR** & **Avg Time (s)** & **std Time (s)** \\ \hline \multirow{4}{*}{data1.txt} & \multirow{2}{*}{184,401} & A & 156,621 & 0.8493 & 0.0836 & 0.0014 \\  & & B & 156,630 & 0.8493 & 0.2687 & 0.0052 \\  & & C & 156,625 & 0.8493 & 0.1749 & 0.0127 \\  & & A & 569,894 & 0.5223 & 0.5565 & 0.0083 \\ data3.txt & 1,091,008 & B & 569,898 & 0.5223 & 1.6488 & 0.0183 \\  & & C & 569,858 & 0.5223 & 1.6279 & 0.7378 \\  & & A & 9614 & 0.7652 & 0.0065 & 0.0010 \\ data4.json & 12,563 & B & 9615 & 0.7653 & 0.0196 & 0.0016 \\  & & C & 9618 & 0.7655 & 0.0130 & 0.0017 \\  & & A & 7197 & 0.8234 & 0.0044 & 0.0001 \\ python.py & 8740 & B & 7199 & 0.8236 & 0.0126 & 0.0012 \\  & & C & 7197 & 0.8234 & 0.0077 & 0.0009 \\  & & A & 32,006 & 0.8388 & 0.0194 & 0.0012 \\ latex.tex & 38,153 & B & 31,986 & 0.8383 & 0.0674 & 0.0023 \\  & & C & 31,985 & 0.8383 & 0.0467 & 0.0044 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Results for selected test files using variant 1 of the method (extended ASCII coding). The list of columns includes filename, size of the text file, PC specification identifier, size of the _png_ file, CR, average time needed to create the _png_ file and standard deviation of the time. The script has been run 100 times.