Giter Club home page Giter Club logo

feuster / resizex Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 30.17 MB

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.

Home Page: https://github.com/feuster/ResizeX

C# 99.10% Batchfile 0.90%
image-processing image-resizing scale2x csharp csharp-library image-resizer fast-image-resizing scale3x cli-image cli-utility

resizex's Introduction

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 size Source
Double size (Scale2x) Source
Triple size (Scale3x) Source

     

Available algorithm groups

Algorithm Description
ResizeX Very fast picture resize with given factor by just cloning the pixels
ScaleX Fast quality picture resize with given factor and a ScaleX algorithm adding details
FastResize Resizes picture faster but probably with less details as the default .net Bitmap class scaler
ResizeNET Resizes picture with the default .net Bitmap class scaler (Reference)
SharpResize Resizes 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:
Resize2x Scale2x FastResize200 Resize200 SharpResize200
60ms 73ms 140ms 143ms 241ms

Resizing the reference picture to 300% size:
Resize3x Scale3x FastResize300 Resize300 SharpResize300
52ms 255ms 290ms 360ms 918ms

Resizing the reference picture to 400% size:
Resize4x Scale4x FastResize400 Resize400 SharpResize400
149ms 325ms 584ms 600ms 1172ms

Resizing the reference picture to 600% size:
Resize6x Scale6x FastResize600 Resize600 SharpResize600
260ms 852ms 1265ms 1357ms 3806ms

Resizing the reference picture to 800% size:
Resize8x Scale8x FastResize800 Resize800 SharpResize800
587ms 1272ms 2230ms 2477ms 4813ms

Resizing the reference picture to 900% size:
Resize9x Scale9x FastResize900 Resize900 SharpResize900
548ms 1748ms 2778ms 3061ms 10115ms

Resizing the reference picture to 1200% size:
Resize12x Scale12x FastResize1200 Resize1200 SharpResize1200
999ms 2961ms 4900ms 5393ms 16283ms

Resizing the reference picture to 1600% size:
Resize16x Scale16x FastResize1600 Resize1600 SharpResize1600
2483ms 4670ms 8586ms 9725ms 19596ms

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

resizex's People

Contributors

feuster avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

bitelchux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.