Multiple scaling example, pnmscale vs pnmleoscale | ||||
---|---|---|---|---|
Generation | Size | Original | pnmscaled | pnmleoscaled |
0 | 100 x 100 | |||
1 | 103 x 101 | |||
2 | 107 x 105 | |||
3 | 111 x 121 | |||
4 | 110 x 119 | |||
5 | 108 x 113 | |||
6 | 110 x 110 | |||
7 | 108 x 108 | |||
8 | 112 x 112 | |||
9 | 100 x 100 |
How about that!?
The image scaled to quadruple size with pnmscale:
The image scaled to quadruple size with pnmleoscale:
Just look at those ears and eyes! Are you now ready to buy pnmleoscale?
The cat shown before will look like the following (and take as much time as shown) after the 9 generations when converted using the different quality values:
9 generations of scaling with pnmleoscale | ||||
---|---|---|---|---|
Quality | Time | Original | Converted | Comments |
pnmscale | 1 | Awful.
The image has lost all detail because of the simple weighted average scheme that has been used to scale it. | ||
0 | 1.5 | The image looks quite a bit better than the one converted with pnmscale did. However, it is easy to see that the white colour in the belly has turned to gray. | ||
1 | 2 | A definitive improvement over the previous one. The belly still isn't white, but it's much nearer the original colour. Some other artifacts have diminished, too. | ||
2 | 2.5 | This already bears a striking resemblence to the original picture. | ||
3 | 3 | This is the default quality value of pnmleoscale. Usually, even after nine generations, it gives images indistinguishable from the original. However, this is not always the case. | ||
4 | 4 | From now on the differences are almost too hard to find. | ||
5 | 6 | |||
6 | 9 | |||
7 | 13 | |||
8 | 20 | |||
9 | 40 | The best, and very CPU-intensive quality setting. Very high quality. |
This picture has been downscaled to 40% with pnmscale:
This picture has been downscaled to 40% with pnmleoscale:
As you can see, pnmleoscale low-pass filters the image before downscaling.
Thus, there is no visible aliasing.
This picture has been upscaled to 400% with pnmscale:
This picture has been upscaled to 400% with pnmleoscale:
This picture has been treated with pnmscale.
This picture has been treated with pnmleoscale.
Anywhere on a line, you may have a "-q n", where n is a digit between 0 and 9, and defines the quality of the conversion. 0 is worst, 9 is best, and 3 is the default.