[cig-commits] [commit] master: Process the new images, and see which ones look good. (6128584)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Fri May 9 15:26:23 PDT 2014


Repository : https://github.com/geodynamics/cigma

On branch  : master
Link       : https://github.com/geodynamics/cigma/compare/65c02138d3ae8b87c088cc14fe4f98e21e3f0805...a26f592c25c89a40622404999ba1effcdf6df9e3

>---------------------------------------------------------------

commit 61285849d999df262b76296b7dba70c8a4d050e8
Author: Luis Armendariz <luis>
Date:   Wed Apr 1 23:08:31 2009 +0000

    Process the new images, and see which ones look good.


>---------------------------------------------------------------

61285849d999df262b76296b7dba70c8a4d050e8
 figures3/bm2/process-images.sh |  16 +++--
 figures3/bm3/process-images.sh | 150 ++++++++++++++++++++++++++---------------
 figures3/common.sh             |  25 +++++--
 3 files changed, 125 insertions(+), 66 deletions(-)

diff --git a/figures3/bm2/process-images.sh b/figures3/bm2/process-images.sh
index 248124c..cbfd712 100755
--- a/figures3/bm2/process-images.sh
+++ b/figures3/bm2/process-images.sh
@@ -1,12 +1,14 @@
 #!/bin/bash
-#
-# See ../bm3/process-images.sh for comments
-#
 
+# Include some common image processing functions
 source ../common.sh
 
+# Enable bash debugging
 set -x
 
+#
+# List of the original images
+#
 imglist="
     temperature_64_20000_y099.png
     velocity_64_20000_y099.png
@@ -18,6 +20,9 @@ imglist="
     log_error_velocity_64_32_20000_9900_y099.png
 "
 
+#
+# Operate on copies of the original images
+#
 orig=${PWD}
 tmp=/tmp/bm2
 mkdir -p $tmp
@@ -75,11 +80,14 @@ cat-pair \
     log_error_velocity_64_32_20000_9900_y099.png \
     fig_log_error_velocity_64_16_64_32_y099.png
 
-
+# finally, resize the images that will be included in the manual
 for img in fig_*; do
     img-resize ${img}
 done
 
+#
+# Copy the images back
+#
 cd ${orig}
 cp -f -v ${tmp}/fig_* ${orig}/out
 
diff --git a/figures3/bm3/process-images.sh b/figures3/bm3/process-images.sh
index 7072f4a..2517ae8 100755
--- a/figures3/bm3/process-images.sh
+++ b/figures3/bm3/process-images.sh
@@ -1,9 +1,11 @@
 #!/bin/bash
 #
-# Some useful links:
-#   http://www.imagemagick.org/Usage/crop/index.html
-#   http://personal.cscs.ch/~mvalle/postprocessing/ImageTools.html
-#
+
+# Include some common image processing functions
+source ../common.sh
+
+# Enable bash debugging
+set -x
 
 #
 # List of the original image names
@@ -11,6 +13,16 @@
 imglist="
     pressure_512.png
     velocity_512.png
+    error_pressure_128.png
+    error_pressure_256.png
+    error_pressure_512.png
+    error_velocity_128.png
+    error_velocity_256.png
+    error_velocity_512.png
+    error_pressure_512_128.png
+    error_pressure_512_256.png
+    error_velocity_512_128.png
+    error_velocity_512_256.png
     log_error_pressure_128.png
     log_error_pressure_256.png
     log_error_pressure_512.png
@@ -36,65 +48,91 @@ cd ${tmp}
 
 
 #
-# Some useful functions
-#
-function concatenate-images
-{
-    local tile=$1
-    shift
-    montage -tile ${tile} -mode Concatenate $*
-}
-
-function trim-image
-{
-    echo $1 ...trimming
-    convert -trim $1 $1
-}
-
-function add-border
-{
-    echo $1 ...adding border
-    convert -border $2 -bordercolor white $1 $1
-}
-
-function resize-image
-{
-    echo $1 ...resizing
-    convert -resize '80%' $1 $1
-}
-
-function concatenate-pair
-{
-    echo Concatenating $1 $2
-    concatenate-images 2x1 $1 $2 $3
-}
-
-#
 # Start processing the images
 #
 
 for img in ${imglist}; do
-    trim-image ${img}
-    add-border ${img} 100
+    img-trim ${img}
+    img-add-border ${img} 100
 done
 
-concatenate-pair pressure_512.png velocity_512.png fig_fields_512.png
-concatenate-pair log_error_pressure_128.png log_error_velocity_128.png fig_log_error_fields_128.png
-concatenate-pair log_error_pressure_256.png log_error_velocity_256.png fig_log_error_fields_256.png
-concatenate-pair log_error_pressure_512.png log_error_velocity_512.png fig_log_error_fields_512.png
 
-concatenate-images 3x1 log_error_pressure_128.png log_error_pressure_256.png log_error_pressure_512.png fig_log_error_pressure.png
-concatenate-images 3x1 log_error_velocity_128.png log_error_velocity_256.png log_error_velocity_512.png fig_log_error_velocity.png
-
-concatenate-images 2x1 log_error_pressure_256.png log_error_pressure_512.png fig_log_error_pressure_256_512.png
-concatenate-images 2x1 log_error_velocity_256.png log_error_velocity_512.png fig_log_error_velocity_256_512.png
-
-concatenate-images 2x1 log_error_pressure_512_128.png log_error_pressure_512_256.png fig_log_error_pressure_512_128_512_256.png
-concatenate-images 2x1 log_error_velocity_512_128.png log_error_velocity_512_256.png fig_log_error_velocity_512_128_512_256.png
-
-
-#
-# finally, resize
+cat-pair \
+    pressure_512.png \
+    velocity_512.png \
+    fig_fields_512.png
+
+
+cat-pair \
+    error_pressure_128.png \
+    error_velocity_128.png \
+    fig_error_fields_128.png
+cat-pair \
+    error_pressure_256.png \
+    error_velocity_256.png \
+    fig_error_fields_256.png
+cat-pair \
+    error_pressure_512.png \
+    error_velocity_512.png \
+    fig_error_fields_512.png
+
+
+cat-pair \
+    log_error_pressure_128.png \
+    log_error_velocity_128.png \
+    fig_log_error_fields_128.png
+cat-pair \
+    log_error_pressure_256.png \
+    log_error_velocity_256.png \
+    fig_log_error_fields_256.png
+cat-pair \
+    log_error_pressure_512.png \
+    log_error_velocity_512.png \
+    fig_log_error_fields_512.png
+
+
+img-cat 3x1 \
+    error_pressure_128.png \
+    error_pressure_256.png \
+    error_pressure_512.png \
+    fig_error_pressure.png
+img-cat 3x1 \
+    log_error_pressure_128.png \
+    log_error_pressure_256.png \
+    log_error_pressure_512.png \
+    fig_log_error_pressure.png
+
+img-cat 2x1 \
+    error_pressure_256.png \
+    error_pressure_512.png \
+    fig_error_pressure_256_512.png
+img-cat 2x1 \
+    log_error_pressure_256.png \
+    log_error_pressure_512.png \
+    fig_log_error_pressure_256_512.png
+
+
+img-cat 2x1 \
+    error_pressure_512_128.png \
+    error_pressure_512_256.png \
+    fig_error_pressure_512_128_512_256.png
+img-cat 2x1 \
+    log_error_pressure_512_128.png \
+    log_error_pressure_512_256.png \
+    fig_log_error_pressure_512_128_512_256.png
+
+
+img-cat 2x1 \
+    error_velocity_512_128.png \
+    error_velocity_512_256.png \
+    fig_error_velocity_512_128_512_256.png
+img-cat 2x1 \
+    log_error_velocity_512_128.png \
+    log_error_velocity_512_256.png \
+    fig_log_error_velocity_512_128_512_256.png
+
+
+# finally, resize the images that will be included in the manual
 for img in fig_*; do
     resize-image ${img}
 done
diff --git a/figures3/common.sh b/figures3/common.sh
index 4685f0f..0dd5634 100644
--- a/figures3/common.sh
+++ b/figures3/common.sh
@@ -1,5 +1,17 @@
 #!/bin/bash
+
+#
+# In this file we define a few useful functions for
+# processing multiple images, based on the ImageMagick
+# manipulation programs
+#
+# Some useful links:
 #
+#   http://www.imagemagick.org/Usage/crop/
+#   http://www.imagemagick.org/Usage/annotating/
+#   http://personal.cscs.ch/~mvalle/postprocessing/ImageTools.html
+#
+
 function img-caption0
 {
     #echo $1 ...adding caption
@@ -32,6 +44,13 @@ function img-cat
     montage -tile ${tile} -mode Concatenate $*
 }
 
+function cat-pair
+{
+    #echo Concatenating $1 $2
+    img-cat 2x1 $1 $2 $3
+}
+
+
 function img-trim
 {
     #echo $1 ...trimming
@@ -50,9 +69,3 @@ function img-resize
     convert -resize '80%' $1 $1
 }
 
-function cat-pair
-{
-    #echo Concatenating $1 $2
-    img-cat 2x1 $1 $2 $3
-}
-



More information about the CIG-COMMITS mailing list