tested on:
ImageMagick7-nox11-7.0.7.4
ImageMagick-nox11-6.9.8.9_1,1
bin/convert manual:
-linear-stretch black-point{xwhite-point}{%}
in perl it would be:
$img->LinearStretch('levels' => AxB, 'black-point' => double, 'white-point' => double);
the results are different and i can't make any arguments for LinearStretch() for result to match to bin/convert's result.
diff page with images:
http://zznine.com/convert-linear-stretch/diff.html
Question:
what should be arguments for LinearStretch() to match:
1) bin/convert -linear-stretch AxB
2) bin/convert -linear-stretch AxB%
LinearStretch() works strange if compared with bin/convert
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: LinearStretch() works strange if compared with bin/convert
I don't use Perl, but looking at Magick.xs, I think the first part ("rho") of the string argument is ignored. So if you have "levels=30%x70%", the 30% is ignored, and zero is used for the black point. It looks as if "black-point" and "white-point" should work, but they need to be the number of pixels, not a percentage.
snibgo's IM pages: im.snibgo.com
Re: LinearStretch() works strange if compared with bin/convert
if bin/convert can calculate % for both black and white argument, it should be the same for perl.
So it would do "the same" image transformation as bin/convert.
Otherwise it is confusing.
So it would do "the same" image transformation as bin/convert.
Otherwise it is confusing.