image-merger

Crates.ioimage-merger
lib.rsimage-merger
version1.1.2
sourcesrc
created_at2023-12-16 23:26:51.236012
updated_at2024-06-28 04:24:09.202827
descriptionA tool to merge multiple images into one.
homepage
repositoryhttps://github.com/NextChai/image-merger
max_upload_size
id1072039
size88,268
Trevor Flahardy (trevorflahardy)

documentation

README

image-merger-banner

Welcome to Image Merger! A crate that provides blazing-fast functionality for merging many images. It is built on top of the image crate and works to boost performance by utilizing parallel processing and avoiding unnecessary costly operations.

What does it mean to "merge" images?

A Merger paces many small images onto a larger canvas in a specific pattern/location. As of today, this library only has one type of Merger, a KnownSizeMerger which focuses on performance as its top priority, but more will be added soon. An example of an output from a KnownSizeMerger is below, this is the general output from the crate's tests.

Install

Run the following Cargo command in your project directory:

cargo add image-merger

Benchmarks

100x100px Fixed-Size Images

The disparity in merging 10,000 images of 100x100 pixels between the merger and a linear implementation is significant. As depicted below, the x-axis illustrates the number of images being merged, ranging from 1 to 10,000, while the y-axis indicates the duration in milliseconds it took to merge all the images. The linear implementation is shown in green and the image merger in orange.

Over the 10,000 image interval, the image merger yielded an average 3.646x speed increase over the linear implementation. Effectively speaking, the combined average time, in ms, to generate a merged image with $n100^2$ pixels is $A(n)= 0.0082n$, where $n$ is the number of merged images. Moreover, the average time to paste a single given pixel, in ms, is $A\left(n\right)=\frac{0.0082n}{100^{2}}$, where $n$ is the number of merged images.

Commit count: 111

cargo fmt