Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Latest commit

 

History

History
63 lines (50 loc) · 3.43 KB

USEME.md

File metadata and controls

63 lines (50 loc) · 3.43 KB

How to Use the Image Processor

For a more detailed overview of the program, see the README.md file.

Overview

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.

Supported Commands

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

Command Line Interface

  1. Copy the res/ImageProcessor.jar file to the directory where you want to run the program.
  2. Open a terminal window and navigate to the directory where you copied the file.
  3. 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.

Script File Interface

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.

  1. Create a text file with the extension .txt in the directory where you want to run the program.
  2. Enter the commands you want to execute in the file, one per line.
  3. Save the file.
  4. Copy the res/ImageProcessor.jar file to the same directory.
  5. Open a terminal window and navigate to the directory where both files are located.
  6. 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).
  7. 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.