Java CLI Based Image Editor
This Java program provides basic image processing operations. It allows users to perform various operations on images, including grayscale conversion, brightness adjustment, image rotation, and horizontal/vertical mirroring.
Description: Converts the input image to grayscale.
Algorithm:
- Get the height and width of the input image.
- Create a new grayscale image with TYPE_BYTE_GRAY.
- Iterate through each pixel:
Description: Increases the brightness of the input image.
Algorithm:
- Get the height and width of the input image.
- Create a new color image with TYPE_3BYTE_BGR.
- Iterate through each pixel:
Description: Decreases the brightness of the input image.
Algorithm:
- Get the height and width of the input image.
- Create a new color image with TYPE_3BYTE_BGR.
- Iterate through each pixel:
Description: Rotates the input image by 90 degrees.
Algorithm:
- Get the height and width of the input image.
- Create a new image with switched height and width.
- Iterate through each pixel:
Description: Mirrors the input image horizontally.
Algorithm:
- Get the height and width of the input image.
- Create a new image with the same dimensions as the input image.
- Iterate through each pixel:
Description: Mirrors the input image vertically.
Algorithm:
- Get the height and width of the input image.
- Create a new image with the same dimensions as the input image.
- Iterate through each pixel:
Description: Blurs the input image using a simple averaging filter.
Algorithm:
- Get the height and width of the input image.
- Create a new image for the blurred result.
- Define a kernel size (e.g., 3x3).
- Iterate through each pixel:
- Compile the Java code using:
javac Main.java
- Run the program with:
java Main
- Choose an operation by entering the corresponding number.
- Follow on-screen instructions for specific operations.
- The edited image will be saved as a new file with a relevant name.