Note: The application tracks images using id strings. All filtering commands save the filtered image under a
new id. To overwrite the original tracked copy enter the same id. (Ex. red panda-image panda-image
)
Command | Usage | Effect |
---|---|---|
quit / q | quit / q |
Quits the application |
load | load [path] [id] [format] |
Loads an image from a file |
save | save [path] [id] [format] |
Saves an image to a file |
horizontal-flip | horizontal-flip [from id] [to id] |
Flips image horizontally |
vertical-flip | vertical-flip [from id] [to id] |
Flips image vertically |
red | red [from id] [to id] |
Greyscales the image using red channel |
green | green [from id] [to id] |
Greyscales the image using green channel |
blue | blue [from id] [to id] |
Greyscales the image using blue channel |
intensity | intensity [from id] [to id] |
Greyscales the image using intensity |
luma | luma [from id] [to id] |
Greyscales the image using luma |
max-value | max-value [from id] [to id] |
Greyscales the image using max value |
brighten | brighten [value] [from id] [to id] |
Brightens the image by a given value |
sepia | sepia [value] [from id] [to id] |
Applies sepia kernel values to the given image |
greyscale | greyscale [value] [from id] [to id] |
Greyscales the image |
sharpen | sharpen [value] [from id] [to id] |
Sharpens the image |
blur | blur [value] [from id] [to id] |
Blurs the image |
... [maskedImage] | [filter] [from id] [mask id] [to id] |
Applies filter using mask |
The application is designed using the MVC pattern. It currently supports three forms of input; the user can specify a script file full of
commands to execute, individual commands can be dispatched from an interactive shell prompt, or, as the default with no flags given,
opens a Graphical User Interface that includes a histogram to reflect the values of the current images channels. Depending on the given view,
commands will either be executed via the GUI or TextView to load images, perform various filters, and then save the images.
This COMPLETE Image Processor Java application is started from the main ImageProcessor class. From this starting point, the functionality is distributed over 4 major packages: model, view, controller, and util.
The model tracks working images the application has loaded. It handles image filtering operations on its tracked images. It does not deal with any file paths or user input.
The GUI View of the parent View displays a Graphical User Interface that allows user interaction with the program to trigger ActionEvents, and display the model's data via a live histogram. The TextView of the parent View handles displaying any text feedback from the application's run cycle to the user as well as prompting them to supply more input.
The controller recieves commands that have either come from a script file or from commands passed in via the user to the View (in any format) and passes them to command objects accordingly. The command objects then ask the model to perform the appropriate operations based on the command. The view is instructed by the command to display useful feedback.
The utility classes supply support for reading and writing images to and from the file system in various formats. The controller makes use of these classes as needed to load in or save images.
- Added support for the Graphical User Interface, creating the Image Processor Frame to represent the GUI window.
- Added support for the implementation of the GUI, including a Histogram (class) that handles RGBImages, a Frame (class) that utilizes the JSwing library to represent every element of the GUI, a GUI View (class) that handles the backend components / actions of the GUI, and a Controller (class) to handle commands coming from a single GUI window
- Added support for EXTRA CREDIT: Partial Image Manipulation. Successfully implemented with by adding a MaskedFilter to the filter bank, adding a MaskedCommand into our CommandRegistry, and testing results with different filters (see test/cs3500/imageprocessor/model/filter/MaskedFilterTest.java for reference)
Note: Most application-specific classes are prefixed with "IP" which stands for Image Processor.
ImageProcessor - The class that begins the application.
IPModel - Represents a model for the image processor application.
IPStandardModel - Represents a standard implementation of the model for the image processor application.
ImageFilter - Represents a filter function performed on a given image.
KernelFilter - Represents a filter that applies a given kernel matrix transformation to every pixel.
CommonFilterMatrices - Stores static common matrices for kernel and color transform filters (incl. greyscale, sepia, blur, and sharpen).
FilterUtil - Represents utilities for the filter classes incl. a reference between a String filter command and ImageFilter object.
MaskedFilter - Represents a filter that applyies a given image manipulation filter to only a masked region of an image.
ChannelModFilter - Represents a filter that modifies a single pixel channel.
ColorTransformationFilter - Represents a filter that modifies a single pixel channel based off of a set kernel of constant values.
BrightnessFilter - Represents a filter that modifies the brightenss value of every pixel.
IntensityFilter - Represents a filter that greyscales every pixel by intensity.
LumaFilter - Represents a filter that greyscales every pixel by luma.
MaxValueFilter - Represents a filter that greyscales every pixel by max value.
RGBFilter - Represents a filter that greyscales every pixel by a given color channel.
MirrorFilter - Represents a filter that reflects each pixel about a given axis.
HorizontalFlipFilter - Represents a filter that reflects an image about the y-axis.
VerticalFlipFilter - Represents a filter that reflects an image about the x-axis.
IPView - Represents a view for the Image Processor application.
IPFrame - Represents a GUI frame (window) for the Image Processor application
ImagePanel - Represents an Image as an extension of the JPanel
IPSwingFrame - Represents a Swing GUI frame (window) for the Image Processor application.
IPSwingGUIView - Represents a view for the IP application that uses a GUI built on Java's Swing library
RGBChannelHistogram - Represents a Histogram of the IP's current image as an extension of the JPanel
IPTextView - Represents a text-based view for the image processor application.
IPAppendableView - Represents an Image Processor application view that appends text logs to an appendable object.
IPLoggingView - Represents an Image Processor application view that logs messages to an appendable object.
IPInteractiveView - Represent an interactive view for an Image Processor application.
IPPreloadedView - Represents a preloaded script view for an Image Processor application.
IPController - Represents a controller for the Image Processor application.
IPParsingController - Represents a controller that parses input from a readable input source.
IPSingleWindowController - Represents a controller that interacts with a single graphical user interface window view
IPCommandBank - Represents a store of commands that can be run with the opportunity to execute one.
IPCommandRegistry - Represents a store of all registered commands for the Image Processor application.
IPCommand - Represents a command for the Image Processor application.
IPModelCommand - Represents a command that operates on the model.
IPLoadCommand - Represents a command that loads a file.
IPSaveCommand - Represents a command that saves a file.
IPFilterCommand - Represents a command that performs a filter on an image.
IPBrightenCommand - Represents a command that performs a brighten filter on an image.
IPMaskedCommand - Represents a command that performs a mask filter.
FileUtils - Holds static utility fuctions to read and write a PPM image from or to a file.
Image - Represents a graphical image.
ChanneledImage - Represents an image that can be reprseented by its pixel channels.
RGBImage - Represents an image with only three channels; red, green, and blue.