Image Sorter Visualizer is an interactive Java GUI application that allows users to load or generate images and then sort the pixels using various sorting algorithms. The program visualizes the sorting process in real-time, providing an engaging way to see how different sorting algorithms work on visual data (pixel brightness or color channels).
The application includes multiple image generation options, several sorting implementations (including extra credit), and the ability to save the final result as a PNG file.
Image Loading and Generation:
Load custom images from file.
Generate preset images:
Gray and Color Gradients
Random Gray and Color Noise
Colored Circle
Extra Credit: Custom Landscape
Pixel Sorting Algorithms (with real-time visualization):
Bubble Sort Horizontally by Brightness (Extra Credit)
Insertion Sort Horizontally by Brightness
Insertion Sort Horizontally by Green Channel
Insertion Sort Vertically by Brightness
Quick Sort Horizontally by Brightness
Quick Sort Vertically by Brightness (Extra Credit)
User Interface:
Menu-driven console interface controlling a graphical ImageViewer
Real-time animation of sorting process (repaint() during sorting)
Timing measurement for each sorting algorithm
Save sorted image as PNG
Technical Features:
Custom PixelColor class for color manipulation
Brightness calculation using HSB color model
Efficent image manipulation with BufferedImage
GUI Programming
Algorithm Implementation:
Bubble, Insertion, and Quick Sort adapted for 2D image data
Image Processing:
Pixel-level manipulation using BufferedImage and RGB values
Object-Oriented Design:
Custom PixelColor class, modular method design
Performance Visualization:
Real-time updates during sorting (repaint())
File Input and Output:
Loading and Saving PNG Images
Startup:
Launches a graphical window with a default random gray noise image.
Main Menu:
Load an image from file
Generate one of the 6 different images
Sorting:
Choose a sorting method.
Output:
Ability to save the final sorted image as a PNG file.
This project deepend my understanding of algorithm visualizationa nd image processing in Java. Implementing multiple sorting algorithms (Bubble, Insertion, and Quick Sort) on a two-dimensional grid of pixels helped me truly internalize how these algorithms work, especially their time complexity and behavior on real data.
Creating a real-time visualization taught me important concepts about GUI programming, event-driven updates, and performance considerations. I also gained experience working with the Java 2D graphics API, BufferedImage, and color models.
The extra credit features challenged me to be creative and implement more complex functionality like vertical Quick Sort.