This toy project was created to learn server and client development along with Maven, Spring Boot, and Java HTTPClient.
To run the project, the server should be started before running the client.
To run the server, use the command:
make run_server
This will run the server locally with port 8080. As the client interacts with the server, logs will be printed on the server's standard out.
To build the client, use the command:
make build_client
This will create a jar file (ServerRunner.jar) in this root folder.
To run the client, use the command:
java -jar ClientRunner.jar [command]
where [command] is the command for the program.
To test the project, use the command:
make test
This will run the unit tests that are in AppTest.java.
The simplest way to find out what commands are available is to use the help command:
java -jar ClientRunner.jar help
This will print information to standard out about what commands are available.
Usage: ClientRunner stats [image path] [address]
Example: java -jar ClientRunner.jar stats image.png http://localhost:8080/
Description: Server will respond with statistics about the image that was sent, including image size, mean color, and most commonly occurring color.
Usage: ClientRunner gray [image path] [address] [output image path]
Example: java -jar ClientRunner.jar gray image.png http://localhost:8080/ gray_image.png
Description: Server will respond with the request image converted into grayscale. This output image will be saved to the specified location.
Usage: ClientRunner red [image path] [address] [output image path]
Example: java -jar ClientRunner.jar red image.png http://localhost:8080/ output.png
Description: Server will respond with the request image's red channel isolated. This output image will be saved to the specified location. The output image will be in grayscale, with white areas representing strong red signals, and black areas representing weak red signals.
Usage: ClientRunner green [image path] [address] [output image path]
Example: java -jar ClientRunner.jar green image.png http://localhost:8080/ output.png
Description: Server will respond with the request image's green channel isolated. This output image will be saved to the specified location. The output image will be in grayscale, with white areas representing strong green signals, and black areas representing weak green signals.
Usage: ClientRunner blue [image path] [address] [output image path]
Example: java -jar ClientRunner.jar blue image.png http://localhost:8080/ output.png
Description: Server will respond with the request image's blue channel isolated. This output image will be saved to the specified location. The output image will be in grayscale, with white areas representing strong blue signals, and black areas representing weak blue signals.
With this example image:
Running java -jar ClientRunner.jar stats example_input.jpg http://localhost:8080/ will output:
Image statistics:
Number of rows: 750
Number of columns: 1000
Number of channels: 3
Most common color:
Channel 0: 10
Channel 1: 18
Channel 2: 21
Occurrences: 1639
Mean color:
Channel 0: 15
Channel 1: 31
Channel 2: 19
Running java -jar ClientRunner.jar blue example_input.jpg http://localhost:8080/ blue_output.jpg will output:
The blue areas of the image (mainly the sky and water) are shown as brighter than other parts of the image, indicating high blue signals.

