Chartmaker is a program that generates a knitting chart from a PPM file using jgraph.
sh setup.sh
All set up!
Use the script convert.sh
to easily utilize jgraph and chartmaker:
sh convert.sh <input file name> <output file name> <arguments>
This converts your input file to the specified output file and applies the arguments (outlined below). Specifying no arguments will output a chart of the same dimensions of the input file, with the same colors, and with gridlines and labels at increments of 10 across the bottom and left sides. Whatever the extension of the output file is, it will convert it to that file type. So, for example, if you specify .pdf, it will convert to PDF, and if you specify .jpg, it will convert to JPG.
The following arguments are currently supported:
no_gridlines
: turns off bold gridlines and numbering.grid_spacing X
: specifies increment of gridlines and number labeling. The default is every 10 blocks.no_numbering
: turns off number labels along width and height. Will still print bold gridlines.all_numbers
: will print a number on every box. Not recommended for very large charts. Will still print gridlines at default 10, or at the specified gridline.tile X Y
: tile the input image, by the given dimensions, where X is the width and Y is the height.pad X
: pads the overall image by X blocks on each edge. If used with tiling, this will pad the resulting image after the tiling and tile padding is performed.background R G B
: specifies the color of the padding blocks as an RGB value with each field ranging 0 to 255. White by default.Note: if you specify conflicting arguments, the program will take the most recent it has received, or the last argument specified, and ignore the previous ones.
Here are the ways I have created PPM files that can be used reasonably with this program:
If you want to use the executables individually, you can do that as well. Chartmaker is ran with the following arguments:
./chartmaker <filename> <a/p> <arguments>
Chartmaker outputs the jgraph on standard out. To put this output into a file, you can use shell redirection and specify the name of your output file. Here's an example:
./chartmaker myfile.ppm p > myoutput.jgr
So, this converts the PPM file myfile to a jgraph file called myoutput. It will create the file myoutput.jgr if it does not exist, or if it does exist, it will overwrite it.
Please see this webpage for more info on how to use jgraph.