An open-source image converter and resizer
Conversimg is an open-source command interpreter program whose purpose is to allow the user to convert and resize images locally without having to resort to external services on the Internet.
Conversimg works with the most standardized image formats. The supported formats are the following:
Version 1.0:
- BMP (Windows bitmap).
- JPG (Joint Photographic Experts Group).
- GIF (Graphic Interchange Format).
- PNG (Portable Network Graphics).
Version 2.0:
Able conversion from image to pdf and viceversa
- From BMP, JPG, GIF, PNG to PDF
- From PDF to jpg bmp BMP gif GIF WBMP iff IFF png PNG JPEG wbmp jpeg
More formats will be added in later versions.
The application has been developed in a gradle project (version 5.6.2) in java programming language. The application has three files written in java to model the converter, the resizer and the main control module. The files are documented to make them as easy to understand as possible.
In order to compile and make use of the application you must install a gradle version on your computer. The following describes how to compile and execute the project.
- To be able to compile the project:
gradle assemble
- To be able to execute the unitary tests:
gradle test
- To be able to execute the above two commands in one
gradle build
If you want to generate an executable for your system you must modify the file gradle.build and indicate the corresponding command to be able to achieve it. However, in the release a runnable jar file is provided to be executed in your personal computer.
The application runs on the following operating systems:
- Windows (all versions).
- Linux (all distributions).
- Mac.
The only requirement is to have gradle installed.
The application has been built, as well as its future versions using continuous integration. Travis has been used for this. The set of tasks you have to execute are in the file .travis.yml. Apart from compiling the project, a set of unit tests in java have been provided to prove that image format validation, conversion and resizing work well. In order to test the resizing and conversion of images, a folder has been provided, called Images, where four images are found in the four possible formats for now.
Commands to run the program are shown below:
- To convert an image to another format:
java -jar Conversimg.jar <-c> <input_image> <output_image>
- To resize an image:
java -jar Conversimg.jar <-r> <input_image> <output_image> <percent>
- To convert from image to pdf
java -jar Conversimg.jar <-ip> <input_image> <output_pdf>
- To convert from pdf to image
java -jar Conversimg.jar <-pi> <input_pdf> <out_put>
The relsease provided has a runnable jar file that contains all referenced dependencies and libraries. So with that file only the program runs correctly on any system where java is installed.
Below are example images that show some execution scenearies of the program realised both in native windowds 10 and in a virtual machine with Debian 10.
- The following image shows how the programm works when the order for convert an image is written correctly:
- The following image shows how the programm works when the order for resize an image is written correctly:
- The following image shows how the programm works when the order for convert an image with a not supported format:
- The following image shows how the programm works when the order is not correct:
- The following image shows how the programm works when an image is resized but the output format is changed: