This JAVA Program takes multiple images from a selects folder and creates with a selectes width and height a random collage. It works with different sized images and different ratio images, so no pre-processing is necessary. Additionally, there are two available shapes to choose from: Rectangle and Hexagon
Features:
Example results (2000x1500 rectangles): (2000x300 rectangles) (2000x2rows hexagon) (2000x4rows hexagon)
Variable | Example | Description |
---|---|---|
SHAPE | Rectangle | The selected shape: Possible values are Rectangle or Hexagon |
||
WIDTH |
1000 | The width of the final image in pixel |
HEIGTH | 400 | The heigth in pixel for Rectangle and number of rows for Hexagon |
||
IMAGE_PATH |
/home/root/images | The complete directory path to your image directory |
Be sure to have maven and java 17 installed.
git clone git@github.com:lr101/PictureCollage.git
mvn install
java -jar target/picturecollage-1.jar "<IMAGE_PATH>" "<SHAPE>" "<WIDTH>" "<HEIGHT>"
Be sure to have docker installed beforehand
docker run \
-e SHAPE="<SHAPE>" \
-e WIDTH="<WIDTH>" \
-e HEIGHT="<HEIGHT>" \
-v "<IMAGE_PATH>:/images" \
lrprojects/picture-collage:latest