Editing Color TSP art
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:// | + | 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 | + | 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. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
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, | + | 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>-- | + | 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 -- | + | % python tspart.py --line-color=yellow --pre --runs=1 --layer="1 - yellow" yellow.pbm |
− | % python tspart.py -- | + | % python tspart.py --line-color=cyan --mid --runs=1 --layer="2 - cyan" cyan.pbm |
− | % python tspart.py -- | + | % 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 -- | + | % python tspart.py --line-color=magenta --mid --runs=1 magenta.pbm |
− | % python tspart.py -- | + | % python tspart.py --line-color=cyan --mid --runs=1 cyan.pbm |
− | % python tspart.py -- | + | % 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> |