Sorry if this is a simple question, but I can't find info online.
I have substracted two images and would like scale the resulting diff image by some constant to make differences more noticeable. I'd imagine ImageMagick is able to do this, but I can't find the right commands for this. Can anyone point me to the right place, documentation?
How to multiply an image by a constant ?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to multiply an image by a constant ?
If you want to multiply all the pixel values by a certain factor, such as 45, then "-evaluate Multiply 45". See http://imagemagick.org/script/command-l ... p#evaluate
"-auto-level" may also be useful.
"-auto-level" may also be useful.
snibgo's IM pages: im.snibgo.com
Re: How to multiply an image by a constant ?
Thanks, it works. I just achieved the same result using -color-matrix. It seems though there is something wrong with the examples here http://www.imagemagick.org/Usage/color_ ... lor-matrix
It doesn't work if colon is placed after input file name as in the example, the convert tool just keeps reading input from console (Windows 8.1).
It doesn't work if colon is placed after input file name as in the example, the convert tool just keeps reading input from console (Windows 8.1).
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: How to multiply an image by a constant ?
The usage pages show Bash commands, not Windows commands. See http://www.imagemagick.org/Usage/windows/
For example, use double-quotes for Windows:
Or, I believe better, don't use spaces so you don't need quotes:
For example, use double-quotes for Windows:
Code: Select all
convert rose: -color-matrix "6x1: 0,0,0,0,0,1" matrix_red_max.png
Code: Select all
convert rose: -color-matrix 6x1:0,0,0,0,0,1 matrix_red_max.png
snibgo's IM pages: im.snibgo.com
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to multiply an image by a constant ?
The colon ':' in "rose:" is part of the name of a built in image. for a file you would not have a colon unless you are specifying the image type of the file. EG: "type:filename"voldemarz wrote:Thanks, it works. I just achieved the same result using -color-matrix. It seems though there is something wrong with the examples here http://www.imagemagick.org/Usage/color_ ... lor-matrix
It doesn't work if colon is placed after input file name as in the example, the convert tool just keeps reading input from console (Windows 8.1).
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/