This is a command-line menu-driven Java application capable of filtering an image using a convolution kernel. It provides robust features for creating custom filters, applying predefined filters, and selecting edge handling methods, all while supporting multiple image formats.
-
Predefined Filters:
- Offers 15 preset filters, including:
- 12 filters with a 3x3 kernel.
- 2 filters with a 5x5 kernel.
- 1 filter with a 9x9 kernel.
- Displays the filter matrix in an ASCII grid format with the filter name.
- Offers 15 preset filters, including:
-
Custom Filters:
- Allows users to create filters by specifying:
- Kernel size: Must be odd and between 3 and 9.
- Kernel values: Accepts positive/negative floating-point numbers within a range of ±999.9.
- Provides labeled matrix rows (letters) and columns (numbers) to simplify input.
- Displays the custom filter matrix and name in the console.
- Allows users to create filters by specifying:
- Supports four methods for handling out-of-bounds pixels during convolution:
- Wrap Mode: Pixels wrap around to the opposite edge.
- Extend Mode: Edge pixels are extended to cover out-of-bounds areas.
- Pad Mode: Adds zero-padding around the image edges.
- Ignore Mode: Ignores calculations for out-of-bounds pixels (default mode).
- Input File Types: Supports PNG, JPG, and GIF formats.
- Input Handling:
- Automatically appends missing file extensions.
- Verifies file existence and prompts users for valid filenames if needed.
- Accepts file names from directories or folders.
- Output File Naming:
- Names output images by concatenating the input filename, filter name, and edge mode.
- Matches the input file type for the output image.
- Option to run the program in debug mode, which generates additional data:
- Creates two text files containing RGB channel data for the input and output images.
- Files are named with the input filename and appended suffixes
_InputRGBand_OutputRGB. - Pixel data is displayed as integers (0-255) for each channel in
[red/green/blue]format.
- Error Handling:
- Detects illegal inputs such as out-of-range values, invalid strings, and empty entries.
- Provides custom error messages for each invalid input scenario.
- Dynamic Menus:
- Prevents menu spam by redisplaying filter options only after multiple invalid inputs.
- Command-line menu allows seamless navigation:
- Main menu options for running the program, selecting filters, setting edge modes, and quitting.
- Submenus for creating filters, choosing edge modes, and managing input sources.
- Program runs continuously until an image is processed or the user quits.
- Java Development Kit (JDK): Version 8 or above.
- Integrated Development Environment (IDE): Eclipse, IntelliJ IDEA, or a text editor with Java support.
- Clone the repository or download the source code.
git clone https://github.com/your-username/image-filtering-system.git
- Open the project in your preferred IDE.
- Compile the Java files:
javac *.java - Run the program by executing the
Runnerclass.
- Select Option 1: Run Program from the main menu.
- Choose a filter (predefined or custom) if not already selected.
- Enter the input image filename.
- Verify the input file and current attributes.
- Execute the program to generate the filtered image.
Access filters via Main Menu > Option 2:
- Choose from 15 preset filters.
- Create a custom filter by defining the kernel size and values.
- View the selected filter matrix and name in the console.
Navigate to Main Menu > Option 3 to select one of four edge modes:
- Wrap Mode
- Extend Mode
- Pad Mode
- Ignore Mode (default)
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
For further information, contact:
- Name: pj-oboyle
- GitHub: pj-oboyle
Thank you for using the Image Filtering System! If you find this project helpful, please give it a star on GitHub.