summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthewsotoudeh <matthewsot@outlook.com>2016-04-12 17:24:56 -0700
committermatthewsotoudeh <matthewsot@outlook.com>2016-04-12 17:24:56 -0700
commit0c9bbfd7f5733cb04561250016fc0b5ed3fe7535 (patch)
treefe322fb049ea2ffbfa34eb57aef4b8cbc6fe9203
parent10a97c0a45884c9584eeb1f01a79787826b4cb8d (diff)
updated the compression numbers
-rw-r--r--Images/bliss.jpg (renamed from Images/original.jpg)bin53185 -> 53185 bytes
-rw-r--r--Images/bliss.nimgbin0 -> 48874 bytes
-rw-r--r--Images/bliss.png (renamed from Images/original.png)bin106638 -> 106638 bytes
-rw-r--r--Images/bliss.reconstructed.jpgbin0 -> 58137 bytes
-rw-r--r--Images/bliss.reconstructed.pngbin0 -> 62683 bytes
-rw-r--r--Images/bliss.reconstructed.zipbin0 -> 58023 bytes
-rw-r--r--Images/output.nimgbin50040 -> 0 bytes
-rw-r--r--Images/reconstructed.jpgbin57691 -> 0 bytes
-rw-r--r--Images/reconstructed.pngbin61040 -> 0 bytes
-rw-r--r--Images/reconstructed.zipbin57565 -> 0 bytes
-rw-r--r--README.md37
11 files changed, 22 insertions, 15 deletions
diff --git a/Images/original.jpg b/Images/bliss.jpg
index 60cc4cb..60cc4cb 100644
--- a/Images/original.jpg
+++ b/Images/bliss.jpg
Binary files differ
diff --git a/Images/bliss.nimg b/Images/bliss.nimg
new file mode 100644
index 0000000..69a5998
--- /dev/null
+++ b/Images/bliss.nimg
Binary files differ
diff --git a/Images/original.png b/Images/bliss.png
index 869e296..869e296 100644
--- a/Images/original.png
+++ b/Images/bliss.png
Binary files differ
diff --git a/Images/bliss.reconstructed.jpg b/Images/bliss.reconstructed.jpg
new file mode 100644
index 0000000..77bd18c
--- /dev/null
+++ b/Images/bliss.reconstructed.jpg
Binary files differ
diff --git a/Images/bliss.reconstructed.png b/Images/bliss.reconstructed.png
new file mode 100644
index 0000000..52c2014
--- /dev/null
+++ b/Images/bliss.reconstructed.png
Binary files differ
diff --git a/Images/bliss.reconstructed.zip b/Images/bliss.reconstructed.zip
new file mode 100644
index 0000000..e55a7f4
--- /dev/null
+++ b/Images/bliss.reconstructed.zip
Binary files differ
diff --git a/Images/output.nimg b/Images/output.nimg
deleted file mode 100644
index 86a3161..0000000
--- a/Images/output.nimg
+++ /dev/null
Binary files differ
diff --git a/Images/reconstructed.jpg b/Images/reconstructed.jpg
deleted file mode 100644
index f3946ea..0000000
--- a/Images/reconstructed.jpg
+++ /dev/null
Binary files differ
diff --git a/Images/reconstructed.png b/Images/reconstructed.png
deleted file mode 100644
index 28678dc..0000000
--- a/Images/reconstructed.png
+++ /dev/null
Binary files differ
diff --git a/Images/reconstructed.zip b/Images/reconstructed.zip
deleted file mode 100644
index dcc1f2b..0000000
--- a/Images/reconstructed.zip
+++ /dev/null
Binary files differ
diff --git a/README.md b/README.md
index c631cbf..e72d547 100644
--- a/README.md
+++ b/README.md
@@ -6,13 +6,13 @@ Uses the limited, slow, and inefficient (but super simple and easy-to-use!) feed
# Show me the numbers
Original PNG image, **106,638 bytes** uncompressed and 106,795 bytes when compressed with the default Windows "send-to" compression:
-![Original PNG image](Images/original.png "Original PNG image")
+![Original PNG image](Images/bliss.png "Original PNG image")
**106,638 bytes**
Original image saved as a JPEG in Paint.net, 53,185 bytes as ``.jpg``, **53,067 bytes** after compressed to ``.zip``:
-![Original JPEG image](Images/original.jpg "Original JPEG image")
+![Original JPEG image](Images/bliss.jpg "Original JPEG image")
**53,067 bytes**
@@ -22,27 +22,28 @@ inputPixels 3
innerLayers 2
neuronsPerLayer 3
colorIndexBytes 2
-writeTolerance 10
+writeTolerance 8
colorIndexTolerance 5
-trainingRounds 25
+trainingRounds 50000
+maxTrainingSets 20
```
-Compressed into an NIMG file of **50,040 bytes**. The ``.nimg`` file (after being converted losslessly to a PNG):
+Compressed into an NIMG file of **48,874 bytes**. The ``.nimg`` file (after being converted losslessly to a PNG):
![Reconstructed NIMG image](Images/reconstructed.png "Reconstructed NIMG image")
-**50,040 bytes**
+**48,874 bytes**
Note that because NIMG is so lossy (see the "Drawbacks" section), the recreated file is **not** the same as the original PNG. NIMG has an option to recreate the NIMG file into a PNG, which is exactly the same image as the compressed NIMG file.
-The reconstructed ``.nimg`` file (exactly the same image as the ``.nimg``), when saved as a PNG, has a file size of **61,040 bytes**.
-Saving that PNG file as a JPEG in Paint.net creates a ``.jpg`` with file size 57,691 bytes, **57,565 bytes** after zip-compressing in Windows.
+The reconstructed ``.nimg`` file (exactly the same image as the ``.nimg``), when saved as a PNG, has a file size of **62,683 bytes**.
+Saving that PNG file as a JPEG in Paint.net creates a ``.jpg`` with file size 58,137 bytes, **58,023 bytes** after zip-compressing in Windows.
All in all:
-- **53.1% reduction** from the original PNG
-- **5.7% reduction** from the original JPG
-- **18% reduction** from the reconstructed image saved as a PNG
-- **13.1% reduction** from the reconstructed image saved as a compressed JPEG.
+- **54.2% reduction** from the original PNG
+- **7.9% reduction** from the original JPG
+- **22% reduction** from the reconstructed image saved as a PNG
+- **15.8% reduction** from the reconstructed image saved as a compressed JPEG.
# Why is it so good?
@@ -90,16 +91,22 @@ colorIndexBytes [ 0 => Disable the color dictionary, 1 => maximum 239 distinct c
writeTolerance [ The maximum difference between the predicted color and the actual color. Lower = large file size, less lossy ]
colorIndexTolerance [ The maximum difference between the pixel color and the color stored in the dictionary. Lower = larger file size, less lossy ]
trainingRounds [ The number of rounds to train the network for. Lower = higher file size, quicker ]
+maxTrainingSets [ The number of training sets to create. Lower = quicker, potentially better-fitted network ]
```
See above for an example ``nimg.config``. Any lines may be removed and will be filled in with default values.
To compress ``image.png`` into ``image.nimg``:
```
-nimg.exe compress image.png
+nimg compress image.png
```
-To convert ``image.nimg`` back into a PNG (which will be named ``image.png``):
+To convert ``image.nimg`` back into a PNG (which will be named ``image.reconstructed.png``):
```
-nimg.exe reconstruct image.nimg
+nimg reconstruct image.nimg
+```
+
+To convert ``image.nimg`` back into a PNG with the 'missing' pixels highlighted in red (as ``image.reconstructed.png``):
+```
+nimg reconstruct image.nimg demo
``` \ No newline at end of file
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback