The Image Processing application supports different image processing functions that can be performed. The commands allow to manipulate images and save them under specified names. Below is a summary of each command and conditions for their use.
How to use the GUI?
Please find the jar file in the res folder. Run the jar with the below command in the terminal:
java -jar ImageProcessing.jar
- Description: This function will apply a blur effect to an image.
- Usage: blur
- Usage with split: blur split
- Usage with mask: blur
- Example:
- blur test output
- blur myImage blurredImage split 50
- blur test mask output
- Conditions:
- If the user is using the split option, the user should provide a valid percentage (1–100).
- Dependencies: The must have already been loaded in the application.
- Description: sharpens an image.
- Usage: sharpen
- Usage with split: sharpen split
- Usage with mask: sharpen
- Example:
- sharpen test output
- sharpen myImage blurredImage split 50
- sharpen test mask output
- Conditions:
- If the user is using the split option, the user should provide a valid percentage (1–100).
- Dependencies: The must have already been loaded in the application.
- Description: Extracts the red component of the image.
- Usage: red-component
- Usage with split: red-component split
- Usage with mask: red-component
- Example:
- red-component myImage redImage
- red-component myImage redImage split 50
- red-component test mask output
- Conditions:
- Note: The image must be loaded prior to running this command.
- If the user is using the split option, the user should provide a valid percentage (1–100).
- Applies only to color images: This command won’t work on grayscale images.
- Description: Extracts the green component of the image.
- Usage: green-component
- Usage with split: green-component split
- Usage with mask: green-component
- Example:
- green-component test output
- green-component test output split 50
- green-component test mask output
- Conditions:
- Note: Image must be loaded before running this command.
- If the user is using the split option, the user should provide a valid percentage (1–100).
- Applies only to color images: This command won’t work on grayscale images.
- Description: Extracts the blue component of the image.
- Usage: blue-component
- Usage with split: blue-component split
- Usage with mask: blue-component
- Example:
- blue-component test output
- blue-component test output split 50
- blue-component test mask output
- Conditions:
- Note: Image must be loaded before running this command.
- If the user is using the split option, the user should provide a valid percentage (1–100).
- Applies only to color images: This command won’t work on grayscale images.
- Description: Calculates the intensity of the image by averaging the RGB components.
- Usage: intensity-component
- Usage with split: intensity-component split
- Usage with mask: intensity-component
- Example:
- intensity-component test output
- intensity-component test output split 50
- intensity-component test mask output
- Conditions:
- Note: Image must be loaded before running this command.
- If the user is using the split option, the user should provide a valid percentage (1–100).
- Applies only to color images.
- Description: This function extracts the luma (brightness) component of the image using a weighted sum of RGB values.
- Usage: luma-component
- Usage with split: luma-component split
- Usage with mask: luma-component
- Example:
- luma-component test output
- luma-component test output split 50
- luma-component test mask output
- Conditions:
- Note: Image must be loaded before running this command.
- If the user is using the split option, the user should provide a valid percentage (1–100).
- Applies only to color images.
- Description: Extracts the value component (the maximum of RGB values for each pixel).
- Usage: value-component
- Usage with split: value-component split
- Usage with mask: value-component
- Example:
- value-component test output
- value-component test output split 50
- value-component test mask output
- Conditions:
- Note: Image must be loaded before running this command.
- If the user is using the split option, the user should provide a valid percentage (1–100).
- Applies only to color images.
- Description: Loads an image from the specified file path into the application for processing.
- Usage: load
- Example: load src/images/sample.png myImage
- Conditions:
- Note: Ensure the file path is correct and accessible.
- The image name specified will be used to reference this image in subsequent commands.
- Description: Saves the specified image to a given file path.
- Usage: save
- Example: save myImage src/images/processed_image.png
- Conditions:
- Note: The image must be loaded or created through a command before saving.
- Ensure that the destination directory exists, or provide a valid file path where the image can be saved.
- Description: Increases or decreases the brightness of the image.
- Usage: brighten
- Example:
- brighten 20 test output
- brighten -10 test output split 50
- Conditions:
- Note: Image must be loaded before running this command.
- The brightness value can be positive (to brighten) or negative (to darken).
- If using the split option, provide a percentage between 1 and 100.
- Description: Applies a sepia tone effect to the specified image.
- Usage: sepia
- Usage with split: sepia split
- Usage with mask: sepia
- Example:
- sepia test output
- sepia test output split 50
- sepia test mask output
- Conditions:
- Note: Image must be loaded before running this command.
- Applies only to color images: This command won’t work on grayscale images.
- Description: Flips the image horizontally.
- Usage: horizontal-flip
- Example: horizontal-flip test output
- Conditions:
- Note: The image must be loaded before running this command.
- Description: Flips the image vertically.
- Usage: vertical-flip
- Example: vertical-flip test output
- Conditions:
- Note: The image must be loaded before running this command.
- Description: Compresses the image file to reduce file size without significant quality loss.
- Usage: compress
- Example: compress test output 70
- Conditions:
- Note: Image must be loaded before running this command.
- compression-level should be a percentage (e.g., 70 for 70% quality).
- Higher percentages retain more quality but result in larger file sizes.
- Description: Generates a histogram for each color channel (red, green, and blue) in the image.
- Usage: histogram
- Example: histogram test output
- Conditions:
- Note: Image must be loaded before running this command.
- This command is generally used for analysis and does not alter the original image.
- Description: Adjusts the color balance of the image to correct color imbalances.
- Usage: color-correct
- Usage with split: color-correct split
- Usage with mask: color-correct
- Example:
- color-correct test output
- color-correct test output split 50
- color-correct test mask output
- Conditions:
- Note: Image must be loaded before running this command.
- Description: Adjusts the brightness levels across shadows, midtones, and highlights in the image.
- Usage: levels-adjust
- Usage with split: levels-adjust < dest-image-name> split
- Usage with Mask: levels-adjust
- Example:
- levels-adjust 20 50 90 test output
- levels-adjust 20 50 90 test output split 30
- levels-adjust 20 50 90 test mask output
- Conditions:
- Note: Image must be loaded before running this command.
- Levels range from 0 to 100, where 0 is the darkest and 100 the brightest.
- Description: This will downsize the Image to the given width and height.
- Usage: downsize
- Example:
- downsize test output 100 100
- Conditions:
- Note: Image must be loaded before running this command.
- The width and height of the new Image should be less than the width and height of the current Image
- Description: Runs a batch of commands from a file.
- Usage: run
- Example: run commands.txt
- Conditions:
- The script file should contain one command per line.
- Commands in the script file should follow the same format as above.
- Note: Ensure all required images are loaded within the script file before processing commands.
- Load the image(s) (e.g., load myImage path/to/image.png).
- Apply commands as desired:
- brighten test output
- blur test output
- value-component test output
- Optionally, run a script file with multiple commands:
- run-script path/to/script.txt
