Possible bug with tile crop and/or fx:standard_deviation

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
pr3sidentspence
Posts: 27
Joined: 2018-10-31T12:29:16-07:00
Authentication code: 1152

Possible bug with tile crop and/or fx:standard_deviation

Post 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.
pr3sidentspence
Posts: 27
Joined: 2018-10-31T12:29:16-07:00
Authentication code: 1152

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

Post by pr3sidentspence »

Whoops, sorry, I should have posted this in Bugs.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
pr3sidentspence
Posts: 27
Joined: 2018-10-31T12:29:16-07:00
Authentication code: 1152

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

Post 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.
pr3sidentspence
Posts: 27
Joined: 2018-10-31T12:29:16-07:00
Authentication code: 1152

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

Post by pr3sidentspence »

FYI, "-alpha off" fixes it for me, too.
Post Reply