Compression Research of Bitmap Data in Three-Dimensional Printing

In the paper, it makes 3-D (three dimensional) printing rapid prototyping bitmap data compression research based on bytes has been conducted, in the 3-D printing rapid prototyping system, where the bitmap data format is adopted, and related data storage space is very large. It firstly analyzes the bitmap data characteristics in 3-D printing rapid prototyping system and the commonly methods used in nondestructive bitmap compression, and it designs the bitmap data compression coding method based on bytes. The compression method has the characteristics such as high compression ratio, fast speed of compression and decompression, less time consuming, etc. Therefore, it can meet the increasing demand of data compression in the 3-D printing rapid prototyping system.


INTRODUCTION
Concept of 3-D printing and rapid prototyping technology was proposed by scansE.M. and cima M J of the Massachusetts institute of technology (MIT) in 1992, 3-D printing is a kind of rapid prototyping technology based on material in drople form, spray forming, it is similar to the single layer ink-jet printing process, namely under the excitation of digital signal, it makes liquid material in the print head work forming droplets or flash droplets, which are formed by jet from the nozzle at a certain frequency and speed, and injected to the specified location, step by step through accumulation, the 3-D entity is formed [1][2][3].Due to the different spraying materials, the 3-D printing can be divided into two categories, namely under the powder forming 3-D printing rapid prototyping technology and the direct forming 3-D printing technology [4][5][6].
In the 3-D printing rapid prototyping system, the data is expressed in bitmap data form, as compared to the other vector data the bitmap data need more storage space.In order to facilitate the support bitmap, in the light curing 3-D printing system, the online real-time slicing and bitmap data generated level are not suitable, and adopting the offline data generation method, namely that through forming data processing software to generate and preserve the bitmap data of layer in slices type.
Since in the light curing 3-D rapid printing system, the jet printing head ejects very little amount of photosensitive resin material each time, and the thickness of forming layer is very thin, therefore in order to improve the forming precision, it needs to cut the CAD model into many layers.Therefore, in the curing light 3-D printing system, hundreds of thousands of layers need to cut the model, thus there are hundreds of *Address correspondence to this author at the Art and Design Department, Nanjing Institute of Technology, 211167, Nanjing, China; Tel: +86013770311954; E-mail: xulijun_nit@163.comthousands of copies of bitmap data which should be saved and also be transmitted, to increase the data volume.When it adopts BMP format to express bitmap data sometime, it needs more than hundreds of megabytes, as a result, in the 3-D printing rapid prototyping system, the compression processing of bitmap data is very necessary.
The bitmap data compression technology in general is to use the inherent redundancy of bitmap data; it can change the large bitmap data file into smaller homogeneous bitmap data files.The ratio of the two size of the bitmap data file (i.e., compression ratio) can determine the degree of compression.The compressed bitmap data can be accurately restored in the data files, the compression coding technology can be divided into lossless and lossy compression technology.Light curing forming process of 3-D printing rapid prototyping system is to print and pile up the layer one by one, and eventually form a three-dimensional entity, each layer of the bitmap data is not allowed to have any loss, or it will influence the forming precision or even influence forming process, thus, in the light curing 3-D printing rapid prototyping system, the bitmap can only adopt lossless data compression technology.Common bitmap data lossless compression methods are mainly for ordinary gray scale and color bitmap image data, and they may have low compression ratio, and they are not suitable for the bitmap data compression in the weak light curing 3-D printing system.This paper combines the needs of bitmap data characteristics and the forming process in the light curing three-dimensional rapid printing system, and designs a new bitmap data compression method based on byte which can be used in the light curing three dimensional printing systems [7][8][9].

CHARACTERISTICS OF BITMAP DATA IN 3-D PRINTING
Curing light level data of 3-D printing system is based on two standard represented monochrome bitmap BMP format, one is the bitmap data entity, and another is support bitmap data.As for BMP monochrome bitmap data, a pixel is expressed with a binary data, namely that: 0 represents no color (which means there is no need to print entity and supporting materials), 1 represent color (for entity bitmap which needs to print material, to support the bitmap need for printed support materials), one byte unit can express eight pixels.The Fig. ( 1) is a chainsaw shell parts which is through data processing, the resulting section of different layers on two standard entities BMP format bitmap data (2644 pixels ×1980 pixels), the casing outside represents the size of the bitmap area.As it can be seen from the Fig. (1), light curing 3-D printing system, its general bitmap data is completely different from the common bitmap image data, it has the following obvious characteristics [10]: In each scan line, the bitmap data is connected with 0 (binary 00000000) or 255 (binary 11111111); binary number from 1 to 256 will appear in each scan line between entity (or support) border area and the blank space, and it will appear only once.

2.
Different slice layers on the bitmap data may vary widely, some sections in the area with the entity may be close to the bitmap area, and diferent bitmap density may have different effects as shown in Fig. (1a-c) some of the slice layer areas with the entity (or support) may constitute only a small part of the whole drawing area domain.
Currently, the mostly commonly used and the most mature lossless compression coding techniques mainly include RLE coding, Lzw coding and Huffman coding.The three commonly used bitmap data lossless compression technologies have low compression and their computation efficiency is also low, they are not suitable for bitmap data compression in all weak light curing 3-D printing systems.

COMPRESSION PRINCIPLE OF BITMAP DATA
Because the popular lossless compression technology is not suitable for the bitmap data compression in the weak light curing 3-D printing system, due to its level of bitmap data and combination of the characteristics of commonly used bitmap compression principle, therefore in the paper, it designs an applicable new bitmap data compression coding method based on bytes has been designed.The compression principle of encoding method is as follows.
As the basic unit of data stored in the computer is the byte, in order to facilitate the reading and writing of bitmap data in the computer, and at the same time in order to avoid the frequent shift operation and comparing operation, in the method, we did not use bitmap compression method commonly used in encoding in pixels of the compression unit.We directly adopt the eight pixels as the compression unit in the bitmap data compression encoding in the light curing 3-D printing systems.According to the numerical size of read bytes and continuously repeating the same value of the standard BMP monochrome bitmap data, the bitmap data can be divided into three categories: the first category is that the numerical order is 0~255; the second category is the value of 1 or 256, the number of consecutive repeats is less than or equal to 254; the third category is a value of 0 or 255, and at same time the continuous repeated number will be more than 254.Combined with light curing 3-D printing bitmap data, the characteristics of rapid prototyping in the level of these three kinds of bitmap data can adopt different compression coding methods.
The first kind of bitmap data compression and encoding is directly expressed by using which 1 byte.In the design, the data will only appear in both entities region and blank area on the scan line, and they are only appeared on the junction of blank area into the entity (or support) area or from the entity area into the blank area, as the same numerical data only appear once in each time, it will not appear in a row form, so there is no need to make compression.The second type of bitmap data compression method is to use two bytes to express, the first byte of the number is 0 or 255 bytes, the second byte represents continuously repeating number of occurrences, maximum compression of the two bytes is the 255×8=2040 pixels, the resolution of the bitmap is 400 dpi, the two bytes can represent continuous space or continuous entity zone with 172.04 mm length in one scan line.In the light curing 3-D printing bitmap data, there are lines of continuous for the entity or blank will not exceed this value.
So it mainly aims for the first class data compression of the entity bitmap data of the scan line, the third type of bitmap data compression method is to use four bytes, the value of first byte is 0 or 255, the second byte value is 255, this is a meaningless sign, the third and fourth bytes represent the number of the same numerical continuously repeated.Four bytes that maximum compression can express the 2 16 -1 = 524280 pixels, which is mainly aimed at some slice layer in continuous multiple scan lines without entity bitmap data or the entities of the bitmap data compression with two consecutive 0 which represent the end of a bitmap data, which mean that behind all the pixel values are 0, it can be seen the principle of compression.
In the light curing method, bitmap data compression encoding process of the 3-D printing system is very simple, it only reads data from the standard BMP bitmap data array, and makes simple comparisons and additional operations, the concrete compression flow chart is shown in Fig. (2).Through the compressed data method, the decoding process becomes very simple, and then it reads the compressed data sequentially, then according to its value it judges the kind of the bitmap data encoding it belongs to, and on the basis of the corresponding coding rules to compress the data decodes standard bitmap data.Thus, it can be found that in the new bitmap data compression method, the process of compression and decompression, there is no complicated calculation, and there only exist the reading and writing of the data, and the simple comparison and addition operations.So its compression and decompression speed will be fast and quick, and at same time its efficiency will be very high.

COMPRESSED FILE STORAGE FORMAT
As mentioned above, in the light curing 3-D printing processes, there are hundreds or even thousands of layers where bitmap data can be saved, the generation of bitmap data is from top to down, the actual print forming is from basement level to top level.In order to achieve the reasonable and orderly storage of the compressed data generated and quick reading of the data from the compressed file, a more reasonable file storage format needs to be designed.
Based on the above requirements, this paper designs a kind of data format which is used in the light curing 3-D printing system to store compressed data file.This file is mainly composed of three parts: file header, level index of bitmap compression data, and compressed data block.File header uses structure types of data, which contain compressed file ID and version number, component models and basic parameters of slice, and the level bitmap compression index data.In the file location information of the light curing 3-D printing system, each level of the BMP bitmap data files in the bitmap file header, the bitmap information header and color table are the same, so it just need to keep a compressed file, this part of the BMP file information is also a structure type of data stored in a file header.File header structures are defined as follows: All aspects of bitmap index in a dynamic array of compressed data block (that is, the level of bitmap compression data index table), a layer corresponds to a (z, pos).When storage of all aspects of bitmap compression data is finished, then it makes the order of bitmap index table according to the z value of the compressed data.
By using index table, the bitmap data can read in sequence according to the actual z value and can find the corresponding layer of the location of bitmap compression data block quickly.
In curing light 3-D printing system, the data blocks for single bitmap compression are made up of two compressed bitmap data, the position compressed data and the support bitmap compression data.
At the beginning of the single-layer bitmap compression block, we set up an identification number with cbiCount: cbiCount=0 represents the layer of bitmap compression data block which contains only one support bitmap compression data; cbiCount = 1 indicates that the layer of the data block contains only one bitmap compression chart in the compression data; cbiCount =2 represents the layer of bitmap compression data block which contains the concreted bitmap compressed data and one support bitmap compression data.At the end of each layer of bitmap compression data block, it sets up a sign cLayerEnd of the block data, it is defined by four bytes of hexadecimal constants.It can be used to read the compressed data to prove the validity of files.Single compressed bitmap data block storage structure is first stored in four bytes of the bitmap to compress the data of the number of bytes which is occupied by cbibyte size, then deposits the bitmap compression data block in order, finally it used two bytes of 0 to express the end of compressed bitmap data block, at the same time when it reads the compressed data, it can be used to verify the correctness of the compressed data block.In this paper, the designed physical structure compressed store data file is shown in Fig. (3).

ANALYSIS OF COMPRESSION EFFECT
In order to test the proposed bitmap lossless compression method based on the bytes and its actual effect of compression, as shown in Fig. (4), it takes the parts of two models as an example, compression of the size of the bitmap data is analyzed, as in Fig. (5)    As it can be seen from the Table 1, the hand saw shell and compression ratio of box parts, respectively are 22.5:1 and 16.2:1, if we remove light curing 3-D printing rapid prototyping processing data and other related data, the actual compression ratio will be inceased.Through the method, bitmap data of different models are compared, and the minimum compression ratio is 13.8:1, the maximum compression ratio is 58.19:1, the concrete compression ratio depends entirely on the structure of the CAD model and shape as shown in the firgure.5, and common bitmap compression ratio of lossless compression method is hard to exceed 10:1.Thus, in this way, we can see that light curing 3-D rapid printing and prototyping technology, the data compression effect in the bitmap is good.
In order to test then extract speed of new bitmap data compression method in the general configuration on the desktop computer, through decompression software testing of the compress data as shown in Table 2, each layer data of two shell gear is decompressed, the average time of molding processing are 2 h 50 m and 3 h 03 m respectively and related data are shown in the Table 2.
As the compression calculation is connected with the other technologies of light curing other algorithms in the 3-D printing rapid prototyping, the single test which is time consuming cannot be conducted, however, in the compression and decompression processes, the calculation is almost the same and the time-consumtion is similar to the bitmap data compression and decompression speed which can meet the technological requirements of the light curing 3-D rapid printing and prototyping system.As there are hundreds of thousands of bitmap data need to be processed in the system, there will be no bottlenecks.

CONCLUSION
This paper analyzes the characteristics of chart data of curing light level in the 3-D printing rapid prototyping system.We design a new bitmap compression based on byte data lossless compression method.The new bitmap compression method fully utilizes light curing 3-D printing system in the bitmap data with high compression ratio and ideal compression effect.After bitmap data compression of CAD model, the minimum compression ratio becomes 12.1:1, with the largest ratio becomes up to 53.9:1.
New bitmap compression method in the light curing 3-D printing rapid prototyping system, in the bitmap data compression and decompression processes, there is no need to do a complicated calculation, its speed is fast, its consumption time is quite less.
As to the light curing 3-D printing rapid prototyping systems, there will be no bottlenecks for the bitmap data which deal with hundreds of thousands of layers, and can meet rapid process requirements of the light curing 3-D printing systems.
According to the compressed data in the process of 3-D printing and rapid prototyping, a corresponding file storage format has been designed, the file storage format can better meet the rational and orderly storage and it can improve the processing speed of generated compressed data when it needs to read data from the compressed file.

Table 1 ,
the data involves the file header, each layer data calibration, height values of the different layers, bitmap data of each layer is in the storage file, and data of light curing 3-D printing needs rapid prototyping processing.