Merge pull request #244 from xexyl/2018-bellard
This commit is contained in:
2 files changed
+19
-13
No files matched your search
@@ -1,3 +1,6 @@
|
|||||||
lena.ppm
|
lena.ppm
|
||||||
prog
|
prog
|
||||||
small.jpg
|
small.jpg
|
||||||
|
fruits.ppm
|
||||||
|
lena512.ppm
|
||||||
|
vintage_cars.ppm
|
||||||
+16
-13
@@ -1,7 +1,7 @@
|
|||||||
# Most inflationary
|
# Most inflationary
|
||||||
|
|
||||||
Fabrice Bellard
|
Fabrice Bellard
|
||||||
<https://bellard.org/>
|
<https://bellard.org/>
|
||||||
|
|
||||||
## To build:
|
## To build:
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ make
|
|||||||
|
|
||||||
```sh
|
```sh
|
||||||
eog lena.ppm # On Linux
|
eog lena.ppm # On Linux
|
||||||
preview lena.ppm # On MacOS
|
open -a Preview lena.ppm # On macOS
|
||||||
|
|
||||||
pngtopnm < Lenna.png | pnmscale 0.25 | cjpeg -arithmetic -dct float -quality 14 > small.jpg
|
pngtopnm < Lenna.png | pnmscale 0.25 | cjpeg -arithmetic -dct float -quality 14 > small.jpg
|
||||||
```
|
```
|
||||||
@@ -27,22 +27,25 @@ pngtopnm < Lenna.png | pnmscale 0.25 | cjpeg -arithmetic -dct float -quality 14
|
|||||||
|
|
||||||
## Judges' comments:
|
## Judges' comments:
|
||||||
|
|
||||||
The file `small.jpg` will be approximately of the same size as the raw image data
|
The file `small.jpg` will be approximately of the same size as the raw image
|
||||||
in the program. Compare the level of the detail and the artifacts of
|
data in the program. Compare the level of the detail and the artifacts of
|
||||||
`small.jpg` and `lena.ppm`.
|
`small.jpg` and `lena.ppm`.
|
||||||
|
|
||||||
Compressing images is just a matter of simple arithmetic and some magic, isn't it?
|
Compressing images is just a matter of simple arithmetic and some magic, isn't
|
||||||
|
it?
|
||||||
|
|
||||||
We could understand some of the arithmetic but none of the magic.
|
We could understand some of the arithmetic but none of the magic.
|
||||||
|
|
||||||
Deciphering the mechanism used for data encoding to make use
|
Deciphering the mechanism used for data encoding to make use of whitespace,
|
||||||
of whitespace, braces and semicolons should be a slightly easier task.
|
braces and semicolons should be a slightly easier task.
|
||||||
|
|
||||||
## Author's comments:
|
## Author's comments:
|
||||||
|
|
||||||
This program outputs a 128x128 RGB image file to the standard output
|
Warning: the program is not protected against invalid input.
|
||||||
using the portable pixmap file format (PPM). It contains the famous
|
|
||||||
"Lena" image which is used in many image compression tests.
|
This program outputs a 128x128 RGB image file to the standard output using the
|
||||||
|
portable pixmap file format (PPM). It contains the famous "Lena" image which is
|
||||||
|
used in many image compression tests.
|
||||||
|
|
||||||
The uncompressed image is 12 times larger than the source code of the
|
The uncompressed image is 12 times larger than the source code of the
|
||||||
program which includes the image data and the complete decoder. The
|
program which includes the image data and the complete decoder. The
|
||||||
@@ -73,8 +76,8 @@ input. Examples:
|
|||||||
```
|
```
|
||||||
|
|
||||||
The original images for [fruits][1] and [vintage cars][2] come from
|
The original images for [fruits][1] and [vintage cars][2] come from
|
||||||
Wikipedia and were resized to a width of 1024 pixels. Warning: the
|
Wikipedia and were resized to a width of 1024 pixels.
|
||||||
program is not protected against invalid input.
|
|
||||||
|
|
||||||
The program should be portable on any Unix system. On Windows the line
|
The program should be portable on any Unix system. On Windows the line
|
||||||
`_setmode(0, 32768); _setmode(1, 32768);` must be added at the start of
|
`_setmode(0, 32768); _setmode(1, 32768);` must be added at the start of
|
||||||
|
|||||||
Reference in new issue
Block a user