This Java-based image editor allows users to perform various image manipulation operations such as:
- Viewing pixel values
- Converting an image to grayscale
- Adjusting image brightness
- Transposing (rotating) the image to the left or right
- Inverting the image horizontally or vertically
- Applying a blur effect
The image editor will take an input image file (e.g., sample.jpg
) and produce the result in an output image file (output.jpg
).
- View Pixel Values: Prints out the pixel values of the input image.
- Convert to Grayscale: Converts the input image to grayscale.
- Increase Brightness: Adjusts the brightness of the input image by a specified percentage.
- Right Transpose: Rotates the image to the right (90 degrees clockwise).
- Left Transpose: Rotates the image to the left (90 degrees counter-clockwise).
- Invert Horizontally: Flips the image along the horizontal axis.
- Invert Vertically: Flips the image along the vertical axis.
- Blur Image: Applies a blur effect to the input image based on pixel grouping.
- Java Development Kit (JDK) installed.
javax.imageio.ImageIO
library (part of the standard JDK) is required for image reading/writing.- An image file named
sample.jpg
or any other image file you'd like to manipulate.
-
Clone the Project
- Clone the repository or download the source code.
-
Compile the Code
- Open a terminal in the project directory.
- Compile the program using the following command:
javac imageeditor.java
-
Run the Program
- After compiling, run the program with the command:
java imageeditor
- After compiling, run the program with the command:
-
Provide Input
- Enter the filename of the image you'd like to manipulate (e.g.,
sample.jpg
). - You will be prompted to select one of the following options:
Enter 1 for Pixel value Enter 2 for Convert IMAGE GRAY Enter 3 for Increase IMAGE BRIGHTNESS Enter 4 for Right Transpose Image Enter 5 for Left Transpose Image Enter 6 for Invert Horizontal Image Enter 7 for Invert Vertical Image Enter 8 for Blur Image
- Enter the filename of the image you'd like to manipulate (e.g.,
-
Save the Output
- Depending on the option selected, the manipulated image will be saved as
output.jpg
in the project directory.
- Depending on the option selected, the manipulated image will be saved as
- To convert the image to grayscale:
3
The manipulated image will be shown in output.jpg
in the same directory.