Skip to content

Repository files navigation

ResizeX

ResizeX is a Fast Image Resizer which can resize images with free size values or with fixed static values whereas the algorithms with static resizing values are faster than the general resizing algorithms. Some of the available algorithms, as for the ScaleXx, are adding also additional pixel information into the image.

Scale2x/Scale3x Examples

Original sizeSource
Double size (Scale2x)Source
Triple size (Scale3x)Source

Available algorithm groups

AlgorithmDescription
ResizeXVery fast picture resize with given factor by just cloning the pixels
ScaleXFast quality picture resize with given factor and a ScaleX algorithm adding details
FastResizeResizes picture faster but probably with less details as the default .net Bitmap class scaler
ResizeNETResizes picture with the default .net Bitmap class scaler (Reference)
SharpResizeResizes picture with more sharpness but slower as the default .net Bitmap class scaler

Information about the Scale2X/Scale3X algorithm can be found at the Scale2x homepage.

Available algorithms

For every algorithm group are 8 algorithms available which scale to 200%, 300%, 400%, 600%, 800%, 900%, 1200% or 1600%.

Remark: some image/scaler combinations may produce errors when images get to big in size/memory consumption!

Library

All the image resizing functions are bundled in the Feuster.Imaging.Resizing.Lib

The library and a nuget package are available in the library release bundle.

Performance Test

The following tables show an example performance comparision of all scaler algorithms on a Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz whereas ResizeXXX is the default .net image scaler. The performance test measures the pure conversion duration within a algorithm group without the time for file handling as loading or saving the image, so the results are independent of the type of storage where the image I/O is done. The performance test is integrated in ResizeX, see commandline reference for details.

Reference Image

The following image is used as reference source for the performance test and can be found in the Examples folder of the project.

"The Superb Parrot" by Bernard Spragg is marked with CC0 1.0. To view the terms, visit https://creativecommons.org/publicdomain/zero/1.0/?ref=openverse.

Performance Results

Resizing the reference picture to 200% size:
Resize2xScale2xFastResize200Resize200SharpResize200
60ms73ms140ms143ms241ms

Resizing the reference picture to 300% size:
Resize3xScale3xFastResize300Resize300SharpResize300
52ms255ms290ms360ms918ms

Resizing the reference picture to 400% size:
Resize4xScale4xFastResize400Resize400SharpResize400
149ms325ms584ms600ms1172ms

Resizing the reference picture to 600% size:
Resize6xScale6xFastResize600Resize600SharpResize600
260ms852ms1265ms1357ms3806ms

Resizing the reference picture to 800% size:
Resize8xScale8xFastResize800Resize800SharpResize800
587ms1272ms2230ms2477ms4813ms

Resizing the reference picture to 900% size:
Resize9xScale9xFastResize900Resize900SharpResize900
548ms1748ms2778ms3061ms10115ms

Resizing the reference picture to 1200% size:
Resize12xScale12xFastResize1200Resize1200SharpResize1200
999ms2961ms4900ms5393ms16283ms

Resizing the reference picture to 1600% size:
Resize16xScale16xFastResize1600Resize1600SharpResize1600
2483ms4670ms8586ms9725ms19596ms

Conclusion:

Overall the ResizeXx, ScaleXx and FastResizeXXX algorithms are faster than the reference ResizeXXX algorithm. With the ResizeXx as fastest algorithm this can be easily up to 2 to 4 times faster than the reference ResizeXXX algorithm!

Usage

ResizeX is a commandline tool which means it is controlled via commandline arguments within a shell or script.

For a full help on the available commandline arguments type:

Resize.exe -h or Resize.exe --help

For help on the available algorithms type:

Resize.exe -l

A standard example for resizing a picture with a fixed scaler algorithm is:

Resize.exe -i [path_to_input_image] -o [path_to_output_image] -s [scalertype]

A standard example for resizing a picture with the FastResize scaler algorithm is:

Resize.exe -i [path_to_input_image] -o [path_to_output_image] -f -x [new_width] -y [new_height]

A standard example for a performance test without saving the result images:

Resize.exe -i [path_to_input_image] -n

A standard example for a performance test with saving the result images:

Resize.exe -i [path_to_input_image] -o [path_to_output_image] -p

Copyright

© Alexander Feuster 2023

ResizeX and Feuster.Imaging.Resizing.Lib are licensed unter the GNU GENERAL PUBLIC LICENSE Version 2

About

ResizeX is a Fast Image Resizer which can resize an image with free size values or with fixed static values whereas the algorithms with static resizing values are faster that the general resizing algorithms. Some of the available algorithms, as for the ScaleXx, are adding also additional pixel information into the image.

Topics

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages