[gegl] tests: add a test case for gegl:color-reduction



commit 155962749d3037f343bafdc2a7f51f1991b09b11
Author: Téo Mazars <teomazars gmail com>
Date:   Wed Dec 4 20:59:21 2013 +0100

    tests: add a test case for gegl:color-reduction

 tests/compositions/Makefile.am                   |    1 +
 tests/compositions/color-reduction.xml           |  190 ++++++++++++++++++++++
 tests/compositions/reference/color-reduction.png |  Bin 0 -> 392801 bytes
 3 files changed, 191 insertions(+), 0 deletions(-)
---
diff --git a/tests/compositions/Makefile.am b/tests/compositions/Makefile.am
index 7fdf5cb..6863d65 100644
--- a/tests/compositions/Makefile.am
+++ b/tests/compositions/Makefile.am
@@ -50,6 +50,7 @@ TESTS = \
   #run-matting-global-big.xml.sh
 
 NO_OPENCL_TESTS = \
+  color-reduction.xml           \
   rgbe-load.xml                 \
   rgbe-save.xml                 \
   shift.xml                     \
diff --git a/tests/compositions/color-reduction.xml b/tests/compositions/color-reduction.xml
new file mode 100644
index 0000000..c5a4f8a
--- /dev/null
+++ b/tests/compositions/color-reduction.xml
@@ -0,0 +1,190 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<gegl>
+  <node operation='svg:src-over'>
+    <node operation='gegl:translate'>
+      <params>
+        <param name='origin-x'>0</param>
+        <param name='origin-y'>0</param>
+        <param name='sampler'>nearest</param>
+        <param name='x'>128</param>
+        <param name='y'>96</param>
+      </params>
+    </node>
+    <node operation='gegl:color-reduction'>
+      <params>
+       <param name='dither-strategy'>None</param>
+       <param name='red-bits'>3</param>
+       <param name='green-bits'>3</param>
+       <param name='blue-bits'>3</param>
+       <param name='seed'>0</param>
+      </params>
+    </node>
+    <node operation='gegl:scale-ratio'>
+      <params>
+       <param name='x'>0.3</param>
+       <param name='y'>0.3</param>
+      </params>
+    </node>
+    <node operation='gegl:load'>
+      <params>
+       <param name='path'>data/car-stack.png</param>
+      </params>
+    </node>
+  </node>
+  <node operation='svg:src-over'>
+    <node operation='gegl:translate'>
+      <params>
+        <param name='origin-x'>0</param>
+        <param name='origin-y'>0</param>
+        <param name='sampler'>nearest</param>
+        <param name='x'>200</param>
+        <param name='y'>160</param>
+      </params>
+    </node>
+    <node operation='gegl:color-reduction'>
+      <params>
+       <param name='dither-strategy'>Floyd-Steinberg</param>
+       <param name='red-bits'>3</param>
+       <param name='green-bits'>3</param>
+       <param name='blue-bits'>3</param>
+       <param name='seed'>0</param>
+      </params>
+    </node>
+    <node operation='gegl:scale-ratio'>
+      <params>
+       <param name='x'>0.3</param>
+       <param name='y'>0.3</param>
+      </params>
+    </node>
+    <node operation='gegl:load'>
+      <params>
+       <param name='path'>data/car-stack.png</param>
+      </params>
+    </node>
+  </node>
+  <node operation='svg:src-over'>
+    <node operation='gegl:translate'>
+      <params>
+        <param name='origin-x'>0</param>
+        <param name='origin-y'>0</param>
+        <param name='sampler'>nearest</param>
+        <param name='x'>256</param>
+        <param name='y'>0</param>
+      </params>
+    </node>
+    <node operation='gegl:color-reduction'>
+      <params>
+       <param name='dither-strategy'>Random</param>
+       <param name='red-bits'>3</param>
+       <param name='green-bits'>3</param>
+       <param name='blue-bits'>3</param>
+       <param name='seed'>0</param>
+      </params>
+    </node>
+    <node operation='gegl:scale-ratio'>
+      <params>
+       <param name='x'>0.5</param>
+       <param name='y'>0.5</param>
+      </params>
+    </node>
+    <node operation='gegl:load'>
+      <params>
+       <param name='path'>data/car-stack.png</param>
+      </params>
+    </node>
+  </node>
+  <node operation='svg:src-over'>
+    <node operation='gegl:translate'>
+      <params>
+        <param name='origin-x'>0</param>
+        <param name='origin-y'>0</param>
+        <param name='sampler'>nearest</param>
+        <param name='x'>0</param>
+        <param name='y'>192</param>
+      </params>
+    </node>
+    <node operation='gegl:color-reduction'>
+      <params>
+       <param name='dither-strategy'>Random Covariant</param>
+       <param name='red-bits'>3</param>
+       <param name='green-bits'>3</param>
+       <param name='blue-bits'>3</param>
+       <param name='seed'>0</param>
+      </params>
+    </node>
+    <node operation='gegl:scale-ratio'>
+      <params>
+       <param name='x'>0.5</param>
+       <param name='y'>0.5</param>
+      </params>
+    </node>
+    <node operation='gegl:load'>
+      <params>
+       <param name='path'>data/car-stack.png</param>
+      </params>
+    </node>
+  </node>
+  <node operation='svg:src-over'>
+    <node operation='gegl:translate'>
+      <params>
+        <param name='origin-x'>0</param>
+        <param name='origin-y'>0</param>
+        <param name='sampler'>nearest</param>
+        <param name='x'>0</param>
+        <param name='y'>0</param>
+      </params>
+    </node>
+    <node operation='gegl:color-reduction'>
+      <params>
+       <param name='dither-strategy'>Resilient</param>
+       <param name='red-bits'>3</param>
+       <param name='green-bits'>3</param>
+       <param name='blue-bits'>3</param>
+       <param name='seed'>0</param>
+      </params>
+    </node>
+    <node operation='gegl:scale-ratio'>
+      <params>
+       <param name='x'>0.5</param>
+       <param name='y'>0.5</param>
+      </params>
+    </node>
+    <node operation='gegl:load'>
+      <params>
+       <param name='path'>data/car-stack.png</param>
+      </params>
+    </node>
+  </node>
+  <node operation='svg:src-over'>
+    <node operation='gegl:translate'>
+      <params>
+        <param name='origin-x'>0</param>
+        <param name='origin-y'>0</param>
+        <param name='sampler'>nearest</param>
+        <param name='x'>256</param>
+        <param name='y'>192</param>
+      </params>
+    </node>
+    <node operation='gegl:color-reduction'>
+      <params>
+       <param name='dither-strategy'>Bayer</param>
+       <param name='red-bits'>3</param>
+       <param name='green-bits'>3</param>
+       <param name='blue-bits'>3</param>
+       <param name='seed'>0</param>
+      </params>
+    </node>
+    <node operation='gegl:scale-ratio'>
+      <params>
+       <param name='x'>0.5</param>
+       <param name='y'>0.5</param>
+      </params>
+    </node>
+    <node operation='gegl:load'>
+      <params>
+       <param name='path'>data/car-stack.png</param>
+      </params>
+    </node>
+  </node>
+</gegl>
+
diff --git a/tests/compositions/reference/color-reduction.png 
b/tests/compositions/reference/color-reduction.png
new file mode 100644
index 0000000..ae2b12e
Binary files /dev/null and b/tests/compositions/reference/color-reduction.png differ


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]