Skip to content

pixelstuermer/img2excel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status License: MIT GitHub release

intro

forthebadge

img2excel 🚀

Convert images into .xlsx files and create awesome Excel art without the usage of macros.

Requirements

For running the command line tool with the terminal, simply Java is required. When using the core module as a dependency within another project, the installation of Lombok might be necessary.

QuickStart

  1. Download the latest release of the command line tool img2excel-cli-{...}.jar.
  2. Run the following command from within your terminal: java -jar /{path}/img2excel-cli-{...}.jar /{path}/{image}.jpg.
  3. Open the resulting .xlsx file after the converter has finished. It is at the same location as the input image file.

Here is a full command example for version 1.0.0 and the sample file hamnoy_small.jpeg. Therefore, we assume that both (jar and image) are located in the same folder. The Excel file will also be generated at this location. Also, the terminal is opened at the same folder:

java -jar img2excel-cli-1.0.0.jar hamnoy_small.jpeg

The command can also be executed from within any other location, giving it the absolute path of the jar and of the image. The Excel file will then be stored at the location of the input image file:

java -jar /some/path/img2excel-cli-1.0.0.jar /another/path/hamnoy_small.jpeg

Usage CLI Tool

The command line tool can handle absolute and relative file paths and can convert popular image file formats (such as .jpg, .jpeg or .png). It therefore needs the path of the input image file as the only argument. Both paths (to the executable jar and to the input image file) can be either absolute or relative.

java -jar /path/img2excel-cli-{...}.jar /path/{...}.jpg

Usage Java

When cloning the core module or when using it as a dependency with the help of Maven, an installation of Lombok might be necessary. Further on, JitPack is helpful for getting Git repositories into your own build:

<dependencies>
    <dependency>
        <groupId>com.github.pixelstuermer</groupId>
        <artifactId>img2excel</artifactId>
        <version>RELEASE</version>
    </dependency>
</dependencies>

To instantiate the converter and to convert images, simply run the following:

Img2ExcelConverter img2ExcelConverter = new Img2ExcelConverter( new File( {...} ) );
img2ExcelConverter.convertImageToExcel();

Recommendations

It is recommended to use really small images. Images with the dimensions around 60*35 pixels are great (yes, this is really small and will take about 4 minutes). Although the application scales bigger images down, it is best practice to scale them down before manually. Excel can only handle a limited amount of cell styles which is why images cannot be converted with their original size.