[cig-commits] r14562 - in doc/cigma/manual/figures3: . bm2 bm3

luis at geodynamics.org luis at geodynamics.org
Wed Apr 1 16:08:31 PDT 2009


Author: luis
Date: 2009-04-01 16:08:31 -0700 (Wed, 01 Apr 2009)
New Revision: 14562

Modified:
   doc/cigma/manual/figures3/bm2/process-images.sh
   doc/cigma/manual/figures3/bm3/process-images.sh
   doc/cigma/manual/figures3/common.sh
Log:
Process the new images, and see which ones look good.


Modified: doc/cigma/manual/figures3/bm2/process-images.sh
===================================================================
--- doc/cigma/manual/figures3/bm2/process-images.sh	2009-04-01 21:24:22 UTC (rev 14561)
+++ doc/cigma/manual/figures3/bm2/process-images.sh	2009-04-01 23:08:31 UTC (rev 14562)
@@ -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 @@
     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 @@
     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
 

Modified: doc/cigma/manual/figures3/bm3/process-images.sh
===================================================================
--- doc/cigma/manual/figures3/bm3/process-images.sh	2009-04-01 21:24:22 UTC (rev 14561)
+++ doc/cigma/manual/figures3/bm3/process-images.sh	2009-04-01 23:08:31 UTC (rev 14562)
@@ -1,16 +1,28 @@
 #!/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
 #
 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 @@
 
 
 #
-# Some useful functions
+# Start processing the images
 #
-function concatenate-images
-{
-    local tile=$1
-    shift
-    montage -tile ${tile} -mode Concatenate $*
-}
 
-function trim-image
-{
-    echo $1 ...trimming
-    convert -trim $1 $1
-}
+for img in ${imglist}; do
+    img-trim ${img}
+    img-add-border ${img} 100
+done
 
-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
-}
+cat-pair \
+    pressure_512.png \
+    velocity_512.png \
+    fig_fields_512.png
 
-function concatenate-pair
-{
-    echo Concatenating $1 $2
-    concatenate-images 2x1 $1 $2 $3
-}
 
-#
-# Start processing the images
-#
+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
 
-for img in ${imglist}; do
-    trim-image ${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
+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
 
-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
+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
 
-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
+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
 
 
-#
-# finally, resize
+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

Modified: doc/cigma/manual/figures3/common.sh
===================================================================
--- doc/cigma/manual/figures3/common.sh	2009-04-01 21:24:22 UTC (rev 14561)
+++ doc/cigma/manual/figures3/common.sh	2009-04-01 23:08:31 UTC (rev 14562)
@@ -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 @@
     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 @@
     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