I am new to Image Processing in general but familar with code writing. There are so many choices in IM that I am unsure what to use for my application.
First, is there a glossary of IM terms somewhere so I know what Mogrify and other terms mean?
Second, is there a command that allows a math operation on each pixel of two seperate .JPG images to create a third image? I know how to perform the Subtract, Add, Difference commands and that works. But I need to do the following equation:
(Image1pixel value - Image2pixelvalue) / (Image1pixel value + Image2pixelvalue)
Then I need to normalize and stretch the result so it fills the whole 8 bit range of 0 to 255 pixel brightness values. I think I can do that.
Thanks so much for any insight on this!
Pixel Math
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Pixel Math
Please read viewtopic.php?f=1&t=9620. Always provide your IM version and platform, since syntax differs.
For new users, see
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/script/comma ... -tools.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
You can solve your problem two ways.
1) Slow way
2) Faster way
(windows syntax)
(unix syntax)
See
http://www.imagemagick.org/script/fx.php
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#math
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#clone
http://www.imagemagick.org/Usage/layers/#convert
http://www.imagemagick.org/Usage/color_mods/#stretching
For new users, see
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/script/comma ... ptions.php
http://www.imagemagick.org/script/comma ... -tools.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
You can solve your problem two ways.
1) Slow way
Code: Select all
convert image1 image2 -fx "(u-v)/(u+v)" -auto-level result
(windows syntax)
Code: Select all
convert image1 image2 ^
( -clone 1 -clone 0 -compose minus -composite ) ^
( -clone 1 -clone 0 -compose plus -composite ) ^
( -clone 3 -clone 2 -compose divide -composite ) ^
-delete 0-3 -auto-level result
Code: Select all
convert image1 image2 \
\( -clone 1 -clone 0 -compose minus -composite \) \
\( -clone 1 -clone 0 -compose plus -composite \) \
\( -clone 3 -clone 2 -compose divide -composite \) \
-delete 0-3 -auto-level result
See
http://www.imagemagick.org/script/fx.php
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#math
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#clone
http://www.imagemagick.org/Usage/layers/#convert
http://www.imagemagick.org/Usage/color_mods/#stretching
Re: Pixel Math
Thanks very much! Will try this tomorrow. Too late tonight. It looks like what I want!
Sorry I forogt to say what version I have. It is ImageMagick 6.9.0 Q16 (32-bit) Windows on
a Vista op system. I am using the DOS-like command line execution method because I can't find anything
about how to run or use a Graphical User Interface or if there even is one.
Sorry I forogt to say what version I have. It is ImageMagick 6.9.0 Q16 (32-bit) Windows on
a Vista op system. I am using the DOS-like command line execution method because I can't find anything
about how to run or use a Graphical User Interface or if there even is one.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Pixel Math
Imagemagick is for the most part command line driven.
For some GUIs see
http://transloadit.imagemagick.org/MagickStudio/
http://jqmagick.imagemagick.org/
For some GUIs see
http://transloadit.imagemagick.org/MagickStudio/
http://jqmagick.imagemagick.org/