theotherphil / imagecli

A command line image processing tool
MIT License
262 stars 5 forks source link

Compare to ImageMagick #1

Open theotherphil opened 5 years ago

theotherphil commented 5 years ago
  1. How usable is this library's function composition compared to ImageMagick? Theirs looks to be more flexible.
  2. What functions are we missing? (See https://imagemagick.org/script/command-line-processing.php#option)
  3. How does performance compare for single operations and long pipelines between this library and ImageMagick?
theotherphil commented 5 years ago

https://www.reddit.com/r/rust/comments/d4inkc/imagecli_a_pure_rust_image_processing_command/f0d07h0?utm_source=share&utm_medium=web2x

https://imagemagick.org/script/identify.php

Edit: created https://github.com/theotherphil/imagecli/issues/17

omac777 commented 5 years ago

You are certainly on the right path when looking to imagemagick as the main inspiration for your tool. It's certainly hard to beat for all its capabilties and supported image formats.

I also see your motivation for rewriting such capability in rust for potential performance improvements when accomplishing similar tasks.

You also highlighted the imagemagick scripting IMHO the most useful and powerful capability. You can create an image from scratch just using the scripting capability by drawing different elements within it i.e. circles, bezier curves, etc...

Of the most useful image formats I believe DDS and OpenEXR:

https://docs.microsoft.com/en-us/previous-versions/windows/desktop/bb153349(v=vs.85)?redirectedfrom=MSDN

OpenEXR https://en.m.wikipedia.org/wiki/OpenEXR

That is because they have the highest bits per component i.e. 64-bit per pixel, 16 bits for Red, 16 for Blue, 16 for Green, 16 for Alpha. ALSO because they provide lossless representation of the image within DDS and OpenExr.

theotherphil commented 5 years ago

Thanks for the comment. This library currently only supports 8 bits per pixel: https://github.com/theotherphil/imagecli/blob/master/src/image_ops.rs#L195. This should definitely be fixed, but it won't be particularly easy.

I intend to add support for more drawing operations (including bezier curves). This should be pretty straightforward. I'm not sure how elaborate I want to get with the scripting. I'd like to have something pretty flexible, but at some point it probably becomes easier to just spin up a python interpreter and use that!

davidssmith commented 5 years ago

Possibly relevant: https://github.com/influenza/wand-of-rust

davidssmith commented 5 years ago

Also it would be useful to have a fast Fourier transform operation, but to do that you'd probably need to depend on a linear algebra library, and Rust doesn't really have a great one yet.

YodaEmbedding commented 5 years ago

Not to derail the discussion, but to speed up development, you can probably add features without worrying too much about performance. RustFFT claims to be reasonably fast (non-GPU). Mark anywhere you use it as FutureOptimizable or something.