changeset 7:8d7cdfd27b73 draft default tip

planemo upload for repository https://github.com/bgruening/galaxytools/new/gm/tools/image_processing/image_processing/ commit 001310e5fc90be6dc931845e1dbbbcb26092b4b4
author bgruening
date Thu, 22 Aug 2024 19:00:39 +0000
parents 32b40811ed51
children
files convert.xml macros.xml test-data/donald-colors-2.jpg test-data/donald-palette.jpg test-data/result_image_compare01.png test-data/result_image_compare02.png test-data/result_image_compare_same.png
diffstat 7 files changed, 211 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/convert.xml	Mon Nov 25 14:11:22 2019 +0000
+++ b/convert.xml	Thu Aug 22 19:00:39 2024 +0000
@@ -1,5 +1,5 @@
-<tool id="graphicsmagick_image_convert" name="Image Converter" version="@VERSION@+galaxy1">
-    <description></description>
+<tool id="graphicsmagick_image_convert" name="Convert image format" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05">
+    <description>with GraphicsMagick</description>
     <macros>
         <import>macros.xml</import>
     </macros>
@@ -14,9 +14,18 @@
             #set $trans_options = ''
         #end if
 
-        gm convert -resize ${resize}%x $trans_options input.${input.ext} temp.${output_format}
+        gm convert
+            -resize ${resize}%x
+            $trans_options
+            #if $palette.palette_select == "automatic"
+            -type Palette
+            #else if $palette.palette_select == "manual"
+            -colors '${palette.palette}'
+            #end if
+            'input.${input.ext}'
+            'temp.${output_format}'
         &&
-        mv temp.${output_format} '${output}'
+        mv 'temp.${output_format}' '${output}'
 ]]>
     </command>
     <inputs>
@@ -28,6 +37,19 @@
             <option value="-rotate 270">rotate 90 degree to the left</option>
             <option value="-rotate 180">rotate 180 degree</option>
         </param>
+
+        <conditional name="palette">
+            <param name="palette_select" type="select" label="Reduce Color Palette">
+                <option value="no" selected="true">No</option>
+                <option value="automatic">Automatic</option>
+                <option value="manual">Manual</option>
+            </param>
+            <when value="automatic" />
+            <when value="manual">
+                <param name="palette" type="integer" min="1" label="Color Palette Size" value="32" help="Number of colors to use, should be in powers of 2 (1, 2, 4, 8, 16, 32, 64, ...), otherwise space is wasted in the palette."/>
+            </when>
+            <when value="no" />
+        </conditional>
         <param name="resize" type="float" value="100" label="Resize (%)" min="0"/>
         <param name="output_format" type="select" label="Output Format">
                 <option value="jpg">jpg</option>
@@ -62,6 +84,23 @@
           <param name="resize" value="50" />
           <output name="output" file="result_image_convert_1.png" compare="sim_size" delta="20000" />
       </test>
+      <test>
+          <param name="input" value="donald.jpg" />
+          <param name="output_format" value="jpg"  />
+          <conditional name="palette">
+              <param name="palette_select" value="automatic" />
+          </conditional>
+          <output name="output" file="donald-palette.jpg" compare="sim_size" delta="20000" />
+      </test>
+      <test>
+          <param name="input" value="donald.jpg" />
+          <param name="output_format" value="jpg"  />
+          <conditional name="palette">
+              <param name="palette_select" value="manual" />
+              <param name="palette" value="2" />
+          </conditional>
+          <output name="output" file="donald-colors-2.jpg" compare="sim_size" delta="20000" />
+      </test>
   </tests>
     <help>
 <![CDATA[
--- a/macros.xml	Mon Nov 25 14:11:22 2019 +0000
+++ b/macros.xml	Thu Aug 22 19:00:39 2024 +0000
@@ -1,13 +1,179 @@
 <macros>
-    <token name="@VERSION@">1.3.31</token>
+    <token name="@TOOL_VERSION@">1.3.44</token>
+    <token name="@VERSION_SUFFIX@">0</token>
     <xml name="requirements">
         <requirements>
-            <requirement type="package" version="@VERSION@">graphicsmagick</requirement>
+            <requirement type="package" version="@TOOL_VERSION@">graphicsmagick</requirement>
             <yield />
         </requirements>
     </xml>
     <xml name="citations">
         <citations>
+            <citation type="bibtex">
+                @misc{graphicsmagick,
+                author = {GraphicsMagick Group},
+                year = {2017},
+                title = {GraphicsMagick Image Processing System},
+                publisher = {GraphicsMagick Group},
+                url = {http://www.graphicsmagick.org},
+                }
+            </citation>
         </citations>
     </xml>
+    <xml name="color">
+        <param name="color" type="select" label="Color">
+            <option value="AliceBlue">AliceBlue</option>
+            <option value="AntiqueWhite">AntiqueWhite</option>
+            <option value="aqua">aqua</option>
+            <option value="aquamarine">aquamarine</option>
+            <option value="azure">azure</option>
+            <option value="beige">beige</option>
+            <option value="bisque">bisque</option>
+            <option value="black">black</option>
+            <option value="BlanchedAlmond">BlanchedAlmond</option>
+            <option value="blue">blue</option>
+            <option value="BlueViolet">BlueViolet</option>
+            <option value="brown">brown</option>
+            <option value="burlywood">burlywood</option>
+            <option value="cadet">cadet</option>
+            <option value="CadetBlue">CadetBlue</option>
+            <option value="chartreuse">chartreuse</option>
+            <option value="chocolate">chocolate</option>
+            <option value="coral">coral</option>
+            <option value="CornflowerBlue">CornflowerBlue</option>
+            <option value="cornsilk">cornsilk</option>
+            <option value="crimson">crimson</option>
+            <option value="cyan">cyan</option>
+            <option value="dark">dark</option>
+            <option value="DarkBlue">DarkBlue</option>
+            <option value="DarkCyan">DarkCyan</option>
+            <option value="DarkGoldenrod">DarkGoldenrod</option>
+            <option value="DarkGray">DarkGray</option>
+            <option value="DarkGreen">DarkGreen</option>
+            <option value="DarkKhaki">DarkKhaki</option>
+            <option value="DarkMagenta">DarkMagenta</option>
+            <option value="DarkOliveGreen">DarkOliveGreen</option>
+            <option value="DarkOrange">DarkOrange</option>
+            <option value="DarkOrchid">DarkOrchid</option>
+            <option value="DarkRed">DarkRed</option>
+            <option value="DarkSalmon">DarkSalmon</option>
+            <option value="DarkSeaGreen">DarkSeaGreen</option>
+            <option value="DarkSlateBlue">DarkSlateBlue</option>
+            <option value="DarkSlateGray">DarkSlateGray</option>
+            <option value="DarkTurquoise">DarkTurquoise</option>
+            <option value="DarkViolet">DarkViolet</option>
+            <option value="DeepPink">DeepPink</option>
+            <option value="DeepSkyBlue">DeepSkyBlue</option>
+            <option value="DimGray">DimGray</option>
+            <option value="DodgerBlue">DodgerBlue</option>
+            <option value="firebrick">firebrick</option>
+            <option value="FloralWhite">FloralWhite</option>
+            <option value="ForestGreen">ForestGreen</option>
+            <option value="fractal">fractal</option>
+            <option value="fuchsia">fuchsia</option>
+            <option value="gainsboro">gainsboro</option>
+            <option value="GhostWhite">GhostWhite</option>
+            <option value="gold">gold</option>
+            <option value="goldenrod">goldenrod</option>
+            <option value="gray">gray</option>
+            <option value="green">green</option>
+            <option value="GreenYellow">GreenYellow</option>
+            <option value="honeydew">honeydew</option>
+            <option value="HotPink">HotPink</option>
+            <option value="IndianRed">IndianRed</option>
+            <option value="indigo">indigo</option>
+            <option value="ivory">ivory</option>
+            <option value="khaki">khaki</option>
+            <option value="lavender">lavender</option>
+            <option value="LavenderBlush">LavenderBlush</option>
+            <option value="LawnGreen">LawnGreen</option>
+            <option value="LemonChiffon">LemonChiffon</option>
+            <option value="LightBlue">LightBlue</option>
+            <option value="LightCoral">LightCoral</option>
+            <option value="LightCyan">LightCyan</option>
+            <option value="LightGoldenrod">LightGoldenrod</option>
+            <option value="LightGoldenrodYellow">LightGoldenrodYellow</option>
+            <option value="LightGray">LightGray</option>
+            <option value="LightGreen">LightGreen</option>
+            <option value="LightPink">LightPink</option>
+            <option value="LightSalmon">LightSalmon</option>
+            <option value="LightSeaGreen">LightSeaGreen</option>
+            <option value="LightSkyBlue">LightSkyBlue</option>
+            <option value="LightSlateBlue">LightSlateBlue</option>
+            <option value="LightSlateGray">LightSlateGray</option>
+            <option value="LightSteelBlue">LightSteelBlue</option>
+            <option value="LightYellow">LightYellow</option>
+            <option value="lime">lime</option>
+            <option value="LimeGreen">LimeGreen</option>
+            <option value="linen">linen</option>
+            <option value="magenta">magenta</option>
+            <option value="maroon">maroon</option>
+            <option value="MediumAquamarine">MediumAquamarine</option>
+            <option value="MediumBlue">MediumBlue</option>
+            <option value="MediumForestGreen">MediumForestGreen</option>
+            <option value="MediumGoldenRod">MediumGoldenRod</option>
+            <option value="MediumOrchid">MediumOrchid</option>
+            <option value="MediumPurple">MediumPurple</option>
+            <option value="MediumSeaGreen">MediumSeaGreen</option>
+            <option value="MediumSlateBlue">MediumSlateBlue</option>
+            <option value="MediumSpringGreen">MediumSpringGreen</option>
+            <option value="MediumTurquoise">MediumTurquoise</option>
+            <option value="MediumVioletRed">MediumVioletRed</option>
+            <option value="MidnightBlue">MidnightBlue</option>
+            <option value="MintCream">MintCream</option>
+            <option value="MistyRose">MistyRose</option>
+            <option value="moccasin">moccasin</option>
+            <option value="NavajoWhite">NavajoWhite</option>
+            <option value="navy">navy</option>
+            <option value="NavyBlue">NavyBlue</option>
+            <option value="none">none</option>
+            <option value="OldLace">OldLace</option>
+            <option value="olive">olive</option>
+            <option value="OliveDrab">OliveDrab</option>
+            <option value="opaque">opaque</option>
+            <option value="orange">orange</option>
+            <option value="OrangeRed">OrangeRed</option>
+            <option value="orchid">orchid</option>
+            <option value="PaleGoldenrod">PaleGoldenrod</option>
+            <option value="PaleGreen">PaleGreen</option>
+            <option value="PaleTurquoise">PaleTurquoise</option>
+            <option value="PaleVioletRed">PaleVioletRed</option>
+            <option value="PapayaWhip">PapayaWhip</option>
+            <option value="PeachPuff">PeachPuff</option>
+            <option value="peru">peru</option>
+            <option value="pink">pink</option>
+            <option value="plum">plum</option>
+            <option value="PowderBlue">PowderBlue</option>
+            <option value="purple">purple</option>
+            <option value="red">red</option>
+            <option value="RosyBrown">RosyBrown</option>
+            <option value="RoyalBlue">RoyalBlue</option>
+            <option value="SaddleBrown">SaddleBrown</option>
+            <option value="salmon">salmon</option>
+            <option value="SandyBrown">SandyBrown</option>
+            <option value="SeaGreen">SeaGreen</option>
+            <option value="seashell">seashell</option>
+            <option value="sienna">sienna</option>
+            <option value="silver">silver</option>
+            <option value="SkyBlue">SkyBlue</option>
+            <option value="SlateBlue">SlateBlue</option>
+            <option value="SlateGray">SlateGray</option>
+            <option value="snow">snow</option>
+            <option value="SpringGreen">SpringGreen</option>
+            <option value="SteelBlue">SteelBlue</option>
+            <option value="tan">tan</option>
+            <option value="teal">teal</option>
+            <option value="thistle">thistle</option>
+            <option value="tomato">tomato</option>
+            <option value="transparent">transparent</option>
+            <option value="turquoise">turquoise</option>
+            <option value="violet">violet</option>
+            <option value="VioletRed">VioletRed</option>
+            <option value="wheat">wheat</option>
+            <option value="white">white</option>
+            <option value="WhiteSmoke">WhiteSmoke</option>
+            <option value="yellow">yellow</option>
+            <option value="YellowGreen">YellowGreen</option>
+        </param>
+    </xml>
 </macros>
Binary file test-data/donald-colors-2.jpg has changed
Binary file test-data/donald-palette.jpg has changed
Binary file test-data/result_image_compare01.png has changed
Binary file test-data/result_image_compare02.png has changed
Binary file test-data/result_image_compare_same.png has changed