Just to clarify what this is. It is a lossy transform for improving lossless image compression. The GUI program "scanline" asks for an input file, a number of bits (1-
and a compression rate. Then it displays the image and slowly (about a minute, it is written in Blitz Basic) transforms it by discarding the low bits you didn't ask for. Also, if the difference from the previous pixel to the left is not greater than the compression rate in all 3 colors, it replaces the pixel with a copy of the previous one, as it will appear when the image is restored. It then asks to proceed with the compression or select new parameters if the quality is not acceptable. If you answer Y, then it compresses (again, about a minute) by setting all but the first pixel in each run to 0. It transforms .png to .simple.bmp, which is ready to compress. If you enter a .simple.bmp file, then it inverts the transform to a .remade.bmp file. It only works on 1024 x 768 images. There are 10 included. There is also the source (scanline.bb) and Windows executable and a copy of zpaq and config files to compress the .bmp file using "zpaq -mbmp_j4 c sample001.simple.bmp".
For comparison, I did some experiments with sample009.png (a mountain scene) and compared with jpeg after converting to 24 bit .bmp first with Windows Paint. For the scanline program, I used the suggested bits=5 and rate=16, and then compressed the original, transformed, and restored .bmp with zpaq using the bmp_j4.cfg model written by Jan Ondrus. As you can see, both the lossy and lossless parts of the transform improved compression. However, there are noticeable artifacts in the restored image like streaks and contour lines. These can be reduced by using more bits and a lower rate, but the compression is not as good.
For comparison I converted to JPEG using cjpeg from the original IJG reference with -quality 40 through 90 and -progressive (indicated by -40p to -90p). The lower quality settings also produce noticeable (but different) artifacts like blocks and ringing around edges. However, JPEG files are much smaller. I also tested the JPEG compression using "zpaq -mjpg_test2" (also by Jan Ondrus) to show further compression. The model only works on baseline, not progressive so I only tested for -q50 and -q90. By itself, progressive mode produces smaller JPEG files than baseline.
Code:
1,472,000 sample009.png
2,359,350 sample009.bmp
1,013,525 sample009.bmp.zpaq
2,359,350 sample009.simple.bmp
303,274 sample009.simple.bmp.zpaq
2,359,350 sample009.remade.bmp
842,937 sample009.remade.bmp.zpaq
93,946 sample009-q40p.jpg
111,276 sample009-q50.jpg
97,706 sample009-q50.jpg.zpaq
107,833 sample009-q50p.jpg
121,874 sample009-q60p.jpg
145,537 sample009-q70p.jpg
185,893 sample009-q80p.jpg
314,402 sample009-q90.jpg
261,181 sample009-q90.jpg.zpaq
282,991 sample009-q90p.jpg