Skip to content

A playground in which I experiment and learn about image filters.

License

Notifications You must be signed in to change notification settings

imjasonmiller/image-filter

Repository files navigation

image-filter ✨

GitHub Workflow Status Codecov GitHub

A playground in which I experiment and learn about image filters.

Usage

Flags

Flag Details Default
-i / --input Image input input.jpg
-o / --output Image output output.jpg
-x Crop x-coordinate 0
-y Crop y-coordinate 0
-w / --width Crop width Image width
-h / --height Crop height Image width
-v Verbose output false

An explanation for each setting can also be found via:

$ image-filter --help

Cropping

Optionally, an image filter can be partially applied in the following way:

$ image-filter -i input.jpg -x 160 -y 160 -w 400 -h 400 gaussian1d -s 50.0

Subcommands

Box blur

Flag Details Default
-r / --radius Blur strength (radius) 1

$ image-filter -i a.jpg -o b.jpg box_blur_1d -r 10
$ image-filter -i a.jpg -o b.jpg box_blur_2d -r 10

Gaussian blur

Flag Details Default
-s / --sigma Blur strength (sigma) 0.84089642

$ image-filter -i a.jpg -o b.jpg gaussian_blur_1d -s 10.0
$ image-filter -i a.jpg -o b.jpg gaussian_blur_2d -s 10.0

Sobel

Flag Details Default
-s / --sigma Blur strength (sigma) None

$ image-filter -i a.jpg -o b.jpg sobel_2d -s 1.0

Benchmarks

Criterion is used to benchmark performance. See the user guide and documentation for information on how to generate reports.

To run a specific benchmark, i.e. gaussian_250x250, the following command can be used:

$ cargo bench -- gaussian_250x250

To save a given baseline to compare against:

$ cargo bench --bench gaussian -- --save-baseline example_a --sample-size 25

To compare against a saved baseline:

$ cargo bench --bench gaussian -- --load-baseline example_b --baseline example_a

Compiling compute shaders

All filters are part of the filters library. If you wish to change or compile the compute shaders, you will have to use glslValidator to compile them to SPIR-V.

$ glslangvalidator -V shader.comp -o shader.comp.spv

As the shaders are currently statically linked, image-filter will have to be recompiled as well.

License

About

A playground in which I experiment and learn about image filters.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages