Test image:
Running from command line:
Code: Select all
convert test.png -threshold 50% test_1.png
This is ok.
The following code should be the same (true?)
Code: Select all
#include <Magick++.h>
int main(int argc, char **argv) {
Magick::Image image;
image.read(argv[1]);
image.threshold(50); // test: 0 0.5 1 50 100 -50 -100 -0.5 50.0
image.write(argv[2]);
return 0;
}
Code: Select all
g++ $(Magick++-config --cppflags --cxxflags --ldflags --libs) -O2 -Wall main.cpp -o main
Code: Select all
./main test.png test_2.png
This is wrong, why? (It is as if all that was not black passed to white). I found no mention of it anywhere on this issue. Here I use only "threshold" because it is what gives me problems.
Thank you very much in advance for any comments, suggestions or help.
Ref:
[1] http://www.jhnc.org/findimagedupes/
ImageMagick Version 6.7.7-10 (command line and Magick++)
g++ Version 4.9.2
OS GNU/Linux Debian Wheezy