Editing Color TSP art

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 2: Line 2:
 
----
 
----
  
http://wiki.evilmadscience.com/s3/eggbot/tspart/cedar.jpg
+
http://mtbaldy.us/~dnewman/tspart/cedar.jpg
  
 
== Introduction ==
 
== Introduction ==
Line 20: Line 20:
 
First, ensure that you are using an image editor which supports CMYK color models.  In the discussion which follows, directions are provided for Adobe Photoshop [1, 2].
 
First, ensure that you are using an image editor which supports CMYK color models.  In the discussion which follows, directions are provided for Adobe Photoshop [1, 2].
  
After opening your image file in Photoshop, use the cmyk.jsx script found in the latest TSP art tool kit download,
+
After opening your image file in Photoshop, change the color model to CMYK via the "Mode..." item of the "Image" menu.  Under the "Mode..." item, select "CMYK Color".  If asked which specific CMYK color model to convert to, just go ahead and use the default which Photoshop suggests. At this point, save your image file as a new file and use the "Photoshop" format, .psd.  
 
 
:[http://code.google.com/p/eggbotcode/downloads/list http://code.google.com/p/eggbotcode/downloads/list]
 
 
 
Run the script using the "Scripts..." item from the "File" menu.  Under "Scripts..." you can select "Browse..." and then browse to the directory with the cmyk.jsx file.  This
 
will produce files named x-black.psd, x-cyan.psd, x-magenta.psd, and x-yellow.psd where "x" is the name of the original file.
 
 
 
If you want to manually do the separations, here are the steps for Photoshop. After opening the image file in Photoshop, change the color model to CMYK via the "Mode..." item of the "Image" menu.  Under the "Mode..." item, select "CMYK Color".  If asked which specific CMYK color model to convert to, just go ahead and use the default which Photoshop suggests. At this point, save your image file as a new file and use the "Photoshop" format, .psd.  
 
  
 
To separate each color out, we will use a fairly manual technique.  A better technique may well exist.
 
To separate each color out, we will use a fairly manual technique.  A better technique may well exist.
Line 39: Line 32:
 
== Stipple each color layer ==
 
== Stipple each color layer ==
  
Follow the directions from [[Producing a stippled image with Gimp]] to generate stippled images of your four .psd files, x-cyan.psd, x-magenta.psd, x-yellow.psd, and x-black.psd.  You can omit in GImp converting the images to grayscale: when Gimp opens the images, they will already be grayscale images.  When adjusting the output levels in each image to "wash it out", try to use the same output level for each file.  Save the results as cyan.pbm, magenta.pbm, yellow.pbm, and black.pbm.
+
Follow the directions from [[Producing a stippled image with Gimp]] to generate stippled images of your four .psd files, cyan.psd, magenta.psd, yellow.psd, and black.psd.  You can omit in GImp converting the images to grayscale: when Gimp opens the images, they will already be grayscale images.  When adjusting the output levels in each image to "wash it out", try to use the same output level for each file.  Save the results as cyan.pbm, magenta.pbm, yellow.pbm, and black.pbm.
  
 
== Generate TSP art ==
 
== Generate TSP art ==
  
When generating the TSP art, we will use the <tt>--stroke</tt> option to tspart.py to control the color of each drawn TSP solution.  Also, so as to make output SVG files which can be combined into a single SVG file, we will also use the <tt>--pre</tt>, <tt>--mid</tt>, and <tt>--post</tt> options.  Those options allow us to say that one output file is to include the preamble of a SVG file, another output fille is to have the postamble, and that the other files should have neither.  Each individual file will not be a complete SVG file.  However, when all the files are appended one after the other, they will create a valid SVG file.
+
When generating the TSP art, we will use the <tt>--line-color</tt> option to tspart.py to control the color of each drawn TSP solution.  Also, so as to make output SVG files which can be combined into a single SVG file, we will also use the <tt>--pre</tt>, <tt>--mid</tt>, and <tt>--post</tt> options.  Those options allow us to say that one output file is to include the preamble of a SVG file, another output fille is to have the postamble, and that the other files should have neither.  Each individual file will not be a complete SVG file.  However, when all the files are appended one after the other, they will create a valid SVG file.
  
 
Before proceeding, we should consider the order in which we want to draw the colors.  On our Eggbot, we probably want to draw yellow first, followed by cyan, then magenta, and then black.  This way we don't soil our yellow pen tip by drawing over darker ink colors.  Similar considerations hold for cyan and magenta.  However, when drawing on our screen, we want the reverse ordering so that yellow doesn't get completely lost under the other colors.  On our screen, the colors won't blend: instead yellow pixels will simply be replaced by pixels of other colors which happen to draw over them.
 
Before proceeding, we should consider the order in which we want to draw the colors.  On our Eggbot, we probably want to draw yellow first, followed by cyan, then magenta, and then black.  This way we don't soil our yellow pen tip by drawing over darker ink colors.  Similar considerations hold for cyan and magenta.  However, when drawing on our screen, we want the reverse ordering so that yellow doesn't get completely lost under the other colors.  On our screen, the colors won't blend: instead yellow pixels will simply be replaced by pixels of other colors which happen to draw over them.
Line 50: Line 43:
  
 
<pre>
 
<pre>
% python tspart.py --stroke=yellow --pre --runs=1 --layer="1 - yellow" yellow.pbm
+
% python tspart.py --line-color=yellow --pre --runs=1 --layer="1 - yellow" yellow.pbm
% python tspart.py --stroke=cyan --mid --runs=1 --layer="2 - cyan" cyan.pbm
+
% python tspart.py --line-color=cyan --mid --runs=1 --layer="2 - cyan" cyan.pbm
% python tspart.py --stroke=magenta --mid --runs=1 --layer="3 - magenta" magenta.pbm
+
% python tspart.py --line-color=magenta --mid --runs=1 --layer="3 - magenta" magenta.pbm
 
% python tspart.py --post --runs=1 --layer="4 - black" black.pbm
 
% python tspart.py --post --runs=1 --layer="4 - black" black.pbm
 
</pre>
 
</pre>
Line 74: Line 67:
 
<pre>
 
<pre>
 
% python tspart.py --pre --runs=1 black.pbm
 
% python tspart.py --pre --runs=1 black.pbm
% python tspart.py --stroke=magenta --mid --runs=1 magenta.pbm
+
% python tspart.py --line-color=magenta --mid --runs=1 magenta.pbm
% python tspart.py --stroke=cyan --mid --runs=1 cyan.pbm
+
% python tspart.py --line-color=cyan --mid --runs=1 cyan.pbm
% python tspart.py --stroke=yellow --post --runs=1 yellow.pbm
+
% python tspart.py --line-color=yellow --post --runs=1 yellow.pbm
 
% cat black.svg magenta.svg cyan.svg yellow.svg > picture.svg
 
% cat black.svg magenta.svg cyan.svg yellow.svg > picture.svg
 
</pre>
 
</pre>

Please note that all contributions to Evil Mad Scientist Wiki are considered to be released under the GNU Free Documentation License 1.3 (see Evil Mad Scientist Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)