Page 1 of 1

Odd "+noise" "-modulate" and "-blur" result

Posted: 2017-01-11T13:08:03-07:00
by GeeMack
ImageMagick 7.0.4-3 on Windows 10 64: I'm working a command that uses "+noise", "-modulate", and "-blur". I ran into a combination that creates an odd result, and I narrowed it down to a very short command to test the issue...

Code: Select all

magick logo:[400x] -alpha set +noise poisson -modulate 100 -blur 0x1 noise_poisson.png
The output of that command is covered with small black squares...

Image

If I omit "-alpha set", the output image is all black.

If I use "+noise" with any types other than "poisson", the issue doesn't occur.

If I omit either the "-modulate" or "-blur", the black squares won't be there. If I switch their order by putting the "-blur" before the "-modulate", the squares don't appear. It doesn't seem to matter what modulate settings I use. The squares do appear with blur settings other than "0x1", including "0x0", but will be different sizes of small black squares depending.

I can easily avoid using this construct for my purposes, but if someone has a need for that particular combination of operations, the black squares don't seem like an expected result. Is it a bug, or have I overlooked something?

Re: Odd "+noise" "-modulate" and "-blur" result

Posted: 2017-01-11T13:25:01-07:00
by fmw42
I get perfectly fine looking noisy images at each stage on IM 6.9.7.2 and IM 7.0.4.2 Q16 Mac OSX using the command below.

Code: Select all

magick logo:[400x] +noise poisson +write tmp1b.png -modulate 100 +write tmp2b.png -blur 0x1 tmp3b.png
I will download and test with the latest versions and report back.

Re: Odd "+noise" "-modulate" and "-blur" result

Posted: 2017-01-11T14:38:09-07:00
by fmw42
It seems to work fine for me also on IM 6.9.7.3 and IM 7.0.4.3 Q16 Mac OSX

Re: Odd "+noise" "-modulate" and "-blur" result

Posted: 2017-01-11T15:06:45-07:00
by GeeMack
fmw42 wrote: 2017-01-11T14:38:09-07:00It seems to work fine for me also on IM 6.9.7.3 and IM 7.0.4.3 Q16 Mac OSX
I've tried it with IM 6.9.6-0 Q16 HDRI and IM 7.0.4-3 Q16 HDRI on Windows 10 x64, and the output image from each has the black squares. When I try your test command...

Code: Select all

magick logo:[400x] +noise poisson +write tmp1b.png -modulate 100 +write tmp2b.png -blur 0x1 tmp3b.png
... the two intermediate images "tmp1b" and "tmp2b" are as expected. The output "tmp3b" has the squares. Might be a Windows specific issue.

Re: Odd "+noise" "-modulate" and "-blur" result

Posted: 2017-01-11T15:44:02-07:00
by magick
HDRI-enabled ImageMagick allows image pixels to exceed the quantum range, typically 0-65535, including going negative. Your command should return proper results with the -clamp option:

Code: Select all

magick 'logo:[400x]' +noise poisson -clamp +write tmp1b.png -modulate 100 +write tmp2b.png -blur 0x1 tmp3b.png

Re: Odd "+noise" "-modulate" and "-blur" result

Posted: 2017-01-11T16:00:24-07:00
by fmw42
To clarify, all my tests above were without HDRI.

Re: Odd "+noise" "-modulate" and "-blur" result

Posted: 2017-01-11T17:20:12-07:00
by GeeMack
magick wrote: 2017-01-11T15:44:02-07:00HDRI-enabled ImageMagick allows image pixels to exceed the quantum range, typically 0-65535, including going negative.
That helps me understand a few issues I've encountered. Thanks!