Page 1 of 1

Possible bug with tile crop and/or fx:standard_deviation

Posted: 2018-12-10T13:18:21-07:00
by pr3sidentspence
Version: ImageMagick 7.0.4-8 Q16 x64 2017-02-13
Windows 10 pro

I might have found a bug. I've got a script that makes the following call to magick.exe:

Code: Select all

magick.exe infile.bmp -crop 1x +repage -format "%[fx:standard_deviation]\n" info: >infile-cols.txt
... to get the standard deviation of each column of pixels in infile.bmp.

Nine times out of ten, this works just fine, but sometimes (4 in 33, so far, to be exact) outputs:

Code: Select all

-1.5259e-005
-1.5259e-005
-1.5259e-005
.
.
.
-1.5259e-005
... for all 995ish lines of the file. I would expect some of the columns (the first 14 and the last 288) to be extremely low as I have drawn a solid-color mask on the images before this command, but it seems to be seeing the same uniform line over and over for the whole image.

Here is an example infile where it fails: https://1drv.ms/u/s!As3ZytCDCPbLj6N-sMEuPv2j3N6bRg. It fails consistently on this file.

Re: Possible bug with tile crop and/or fx:standard_deviation

Posted: 2018-12-10T14:37:01-07:00
by pr3sidentspence
Whoops, sorry, I should have posted this in Bugs.

Re: Possible bug with tile crop and/or fx:standard_deviation

Posted: 2018-12-10T14:45:48-07:00
by snibgo
I'll move it.

I don't know why that particular file causes problems, or if there is a bug. With v7.0.7-28 I get your bad result, but v6.9.9-50 works fine.

With v7.0.7-28, "-alpha off" after reading the input seems to fix the problem.

Re: Possible bug with tile crop and/or fx:standard_deviation

Posted: 2018-12-10T16:20:11-07:00
by pr3sidentspence
Thanks for that workaround!

What's funny is I have one original B2E-007-008-009-back.bmp file that I make three crops from to get three smaller BMPS: B2E007-back.bmp, B2E008-back.bmp, and B2E009-back.bmp.

B2E007-back.bmp getting the standard deviations on the pixel rows fails
B2E008-back.bmp it's the columns that fail
B2E009-back.bmp both rows and columns are fine.

Re: Possible bug with tile crop and/or fx:standard_deviation

Posted: 2018-12-10T16:24:00-07:00
by pr3sidentspence
FYI, "-alpha off" fixes it for me, too.