- Load and save image files in JPG, PNG, BMP and PPM formats.
- Basic image manipulation operations such as adjusting brightness, horizontal and vertical flips.
- Advanced image manipulation operations, such as greyscale conversion, blur, sharpen, sepia, dither.
- RGB split and combine operations.
- Live histogram display of the loaded image.
- To load an image, click on File > Open, select an image file from the file dialog, and click Open.
- The loaded image will be displayed in the left panel, and its histogram in the right panel.
- To manipulate the image, use the buttons in the Basic Operations panel, or the dropdowns in the Advanced Operations panel.
- To save the manipulated image, click on File > Save As, and choose a destination and format for the file.
- To exit the application, click on File > Exit.
Please refer the screenshot below for more details.
The image view panel on the top left of our application displays the image once it is loaded. It keeps updating the live image as and when the edits are made by the users.
The basic operations panel allows editing the image to apply the basic operations. The value of
the brightness adjustment should be numeric and should be entered in the text box, after which
clicking the button would brighten (if the value is positive) and darken (if the value entered
is negative) by that value. Horizontal and vertical flip can be simply performed by clicking the
respective buttons.
The histogram panel, which is on the top right of our application displays the live histogram of the image. It is an interactive histogram, which allows to be zoomed, to focus on a specific part of the histogram.
The advanced operations panel supports the greyscale variants (Red, Green, Blue, Value, Luma, Intensity), filters (blur and sharpen). To apply operations, choose the options from the dropdown menu and click the execute button for respective operations.
Additional operations supported in the advanced operations panel are sepia and dither.
Moreover, RGB Split and RGB combine allows to split an image, or combine three images of same dimensions into one. For splitting, three different file locations should be input by the user to choose where to save the split images. On the other hand, for combine, the user must choose three different file types to combine. Failing to do so will result into an error.
- Open terminal/cmd at the location of jar file :
res
->ImageManipulationAndEnhancement.jar
- Run
java -jar ImageManipulationAndEnhancement.jar -file commands.txt
The above step runs all the commands that are supported by the applications and operates on the test image and saves all the resulting images in the res folder.
- open terminal/cmd at location where the jar file is present :
res
->ImageManipulationAndEnhancement.jar
- Run
java -jar ImageManipulationAndEnhancement.jar
- In
src
- Open file
Main.java
- Run the
public static void main
method
run commands.txt
Running the above script also runs all the commands, similar to what we saw above, but here it is running inside the program interactively.
load test.ppm test-ppm
load test.png test-png
load test.jpg test-jpg
load test.bmp test-bmp
save test-ppm.ppm test-ppm
save test-png.png test-png
save test-jpg.jpg test-jpg
save test-bmp.bmp test-bmp
rgb-split test-ppm test-red test-green test-blue
save test-green-split.jpg test-green
Commands to rgb-combine
the three red, green, and blue image. And save the file in any of the supported formats.
rgb-combine test-combine test-red test-green test-blue
save test-combine.png test-tint
brighten 50 test-ppm test-brighter
save test-brighter-bmp.bmp test-brighter
brighten -50 test-ppm test-darken
save test-darken-bmp.bmp test-darken
Commands to greyscale
the file test.png
and test.jpg
into all component. And save the file in any of the supported formats.
greyscale value-component test-png test-value-greyscale
save test-value-greyscale-ppm.ppm test-value-greyscale
greyscale luma-component test-png test-luma-greyscale
save test-luma-greyscale-jpg.jpg test-luma-greyscale
greyscale intensity-component test-png test-intensity-greyscale
save test-intensity-greyscale-bmp.bmp test-intensity-greyscale
greyscale red-component test-jpg test-red-greyscale
save test-red-greyscale-ppm.ppm test-red-greyscale
greyscale green-component test-jpg test-green-greyscale
save test-green-greyscale-png.png test-green-greyscale
greyscale blue-component test-jpg test-blue-greyscale
save test-blue-greyscale-bmp.bmp test-blue-greyscale
One thing to note here is that, we were already supporting the method for greyscale (luma) which
is also theoretically, as well as practically the same image as color transformation of
greyscale. Hence, the client can make use of the luma-component
command for the use-cases.
Commands to flip
(Both vertically and horizontally) the file test.bmp
. And save the file in any of the supported formats.
horizontal-flip test-bmp test-horizontal
save test-horizontal-ppm.ppm test-horizontal
vertical-flip test-horizontal test-horizontal-vertical
save test-horizontal-vertical-png.png test-horizontal-vertical
vertical-flip test-bmp test-vertical
save test-vertical-jpg.jpg test-vertical
blur test-ppm test-blur
save test-blur-ppm.ppm test-blur
sharpen test-png test-sharpen
save test-sharpen-png.png test-sharpen
Commands to apply color transformations to create greyscale
of the file test.jpg
. And save the file in any of the supported formats.
greyscale luma-component test-png test-luma-greyscale
save test-luma-greyscale-jpg.jpg test-luma-greyscale
Commands to apply color transformations to create sepia-tone
of the file test.jpg
. And save the
file in any of the supported formats.
sepia test-jpg test-sepia
save test-sepia-jpg.jpg test-sepia
dither test-bmp test-dither
save test-dither-bpm.bmp test-dither