Ultimage is a command-line image processing software that allows users to perform basic image manipulations. The software can load images, apply specified operations, and optionally display or save the processed images.
Ultimage can be installed either by cloning this repository and installing dependencies, or using Docker.
To install Ultimage using Python, ensure you have Python installed. Clone the repository and install the required dependencies.
git clone https://github.com/PCP2024/ultimage.git
cd ultimage
pip install -r requirements.txt
Ultimage is also on Docker Hub and can be installed and run using Docker.
Ensure you have Docker installed on your system. If not, download and install it from here.
Pull the Docker image:
docker pull gerapago/ultimage:latest
Run the Docker container interactively
docker run -it ultimage /bin/bash
Ultimage provides a command-line interface with various options to process images. Below are the available arguments and their descriptions:
main_ultimage.py [-h] [-v] [-n] [-s] [-i IN_PATH] [-o OUT_PATH] [-r ANGLE] [-m {-1,1}] [-c X0 Y0 WIDTH HEIGHT] [-rs SCALE] [-t TEXT X Y COLOR SIZE] [-bg KSIZE SIGMA] [-bn KSIZE]
-v
, --version
: Show the software version.-n
, --noshow
: Stops the display of the image.-s
, --save
: Saves the image to the output directory.-i IN_PATH
, --in_path IN_PATH
: The path to the image file.-o OUT_PATH
, --out_path OUT_PATH
: The path to the output file.-r ANGLE
, --rotate ANGLE
: The angle of rotation in degrees.-m {-1,1}
, --mirror {-1,1}
: The axis of mirroring (-1 for vertical, 1 for horizontal).-c [X0 Y0 WIDTH HEIGHT]
, --crop [X0 Y0 WIDTH HEIGHT]
: The coordinates of the crop region in the form [X0 Y0 WIDTH HEIGHT].-rs SCALE
, --scale SCALE
: The factor to rescale the image by (out of 1).-t [TEXT X Y COLOR SIZE]
, --text [TEXT X Y COLOR SIZE]
: The text to overlay on the image, the coordinates, and font size and color in the form ['text', left, top, color, size].-bg [KSIZE1 KSIZE2 SIGMA]
, -blur_gauss [KSIZE1 KSIZE2 SIGMA]
: The kernel size and sigma for Gaussian blur in the form [ksize1, ksize2, sigma].-bn [KSIZE1 KSIZE2]
, -blur_gauss [KSIZE1 KSIZE2]
: The kernel size for normalized box blur the form [ksize1, ksize2]python3 main_ultimage.py -v
python3 main_ultimage.py -i demodata/demo.jpg -r 45
python3 main_ultimage.py -i demodata/demo.jpg -o demodata/output.jpg -r 45 -n
python3 main_ultimage.py -i demodata/demo.jpg --crop 0 0 100 200 -n
python3 main_ultimage.py -i demodata/demo.jpg -rs 0.5 -t 'Hello, world' 30 15 '#fff' 25
docker run ultimage -v
docker run -it ultimage /bin/bash
root@dc7b867b4c58:/app#>> python3 main_ultimage.py -i demodata/demo.jpg -r 45 -o demodata/output.jpg
To export images generated when running ultimage via Docker:
docker run -it ultimage /bin/bash
python3 main_ultimage.py -rs 2 -i input.jpg -o output.jpg -n
docker ps -a
docker commit [container nickname] temp_image
docker run -it --rm --name temp_container temp_image /bin/bash
docker cp temp_container:/full/path/to/file /path/to/host/destination
This project is licensed under the GNU Affero General Public License v3.0. See LICENSE for more details.
Ultimage was developed by Joana Seabra and Gerardo Parra, with contributions from Benjamin Stephenson. This project was part of the BCCN SoSe 2024 Programming Course and Project (PCP) with instructors Dr. Matthias Haberl and Dr. Henning Sprekeler.