For a more detailed overview of the program, see the README.md file.
The image processor can currently be used in two ways: via the command line interface, or via an imported script file. The command line interface allows users to enter commands with real-time feedback displayed int the terminal window. The script file interface makes it easy to run a series of commands in a batch process.
The following commands are supported by both the command line interface and the script file interface:
- "quit" - quits the program
- "menu" - displays the menu of commands
- "load" - loads an image (identified by given name) into the processor ( supports ppm, png, jpg, jpeg)
- "save" - saves an image to an output file (supports ppm, png, jpg, jpeg)
- "visualize-
<component>
"<filename>
<new filename>
- transforms an image to a new greyscale image using a chosen component<component>
can be "red", "green", "blue", "value", "intensity", or "luma"
- "brighten"
<amount>
<filename>
<new filename>
- transforms an image to a new image brightened by an amount - "darken"
<amount>
<filename>
<new filename>
- transforms an image to a new image darkened by an amount - "horizontal-flip"
<filename>
<new filename>
- horizontally flips an image to a new image - "vertical-flip"
<filename>
<new filename>
- vertically flips an image to a new image - "blur"
<filename>
<new filename>
- transforms an image to a new blurred image - "sharpen"
<filename>
<new filename>
- transforms an image to a new sharpened image - "sepia"
<filename>
<new filename>
- transforms an image to a new sepia filtered image - "greyscale"
<filename>
<new filename>
- transforms an image to a new greyscale filtered image
- Copy the
res/ImageProcessor.jar
file to the directory where you want to run the program. - Open a terminal window and navigate to the directory where you copied the file.
- Enter the command
java -jar ImageProcessor.jar
to run the program.
Upon launch, the user will be shown a welcome message, with the option to "quit" the program or view
a "menu" of available commands. After entering a command and hitting the return key, the program
will either display a detailed error message or a success message. The user can enter the
command quit
at any time to exit the program.
A script file is a text file containing a series of commands to be executed by the program. The script file should only contain supported commands, with one command per line. Extra line breaks can be added for readability, but will not affect the program's execution.
- Create a text file with the extension
.txt
in the directory where you want to run the program. - Enter the commands you want to execute in the file, one per line.
- Save the file.
- Copy the
res/ImageProcessor.jar
file to the same directory. - Open a terminal window and navigate to the directory where both files are located.
- Enter the command
java -jar ImageProcessor.jar -script <script file name>
to run the program.- An example script file is provided in the
res
directory (example-script.txt
).
- An example script file is provided in the
- The program will execute the commands in the script file, and display the success/failure of each command in the terminal window as if you were entering the commands manually.