Page 1 of 1

How do I use -seed with +noise Random

Posted: 2008-12-20T18:23:32-07:00
by fmw42
How do I specify a new seed when generating a random noise image? For example:

convert -size 100x100 xc: -seed +noise Random tmp.png

returns error:
convert: invalid argument for option `+noise': -seed @ convert.c/ConvertImageCommand/2194.


Is this a bug or am I not using it correctly?

IM 6.4.7-10 Q16 Mac OSX Tiger

Re: How do I use -seed with +noise Random

Posted: 2008-12-20T19:29:45-07:00
by magick
How do I specify a new seed when generating a random noise image? For example:
Try this command:
  • convert -size 100x100 xc: -seed 171713 +noise Random tmp.png

Re: How do I use -seed with +noise Random

Posted: 2008-12-21T13:38:36-07:00
by fmw42
magick wrote:
How do I specify a new seed when generating a random noise image? For example:
Try this command:
  • convert -size 100x100 xc: -seed 171713 +noise Random tmp.png

OK, perhaps I misunderstand. If I leave off the -seed, and create two random images with two separate command lines, will the two images be the same random pattern or differerent? Are you changing the seed on each command line in some way and if so using what key for the seed?


convert -size 100x100 xc: +noise Random tmp1.png
convert -size 100x100 xc: +noise Random tmp2.png

My tests seem to show different patterns. So perhaps I don't need to use -seed.

Re: How do I use -seed with +noise Random

Posted: 2008-12-21T15:08:05-07:00
by magick
The random images will always differ if a seed is not specified or if two commands have different seeds (i.e. -seed 17171 and -seed 17172). If the seeds are the same, the resulting images will be the same.

Re: How do I use -seed with +noise Random

Posted: 2008-12-21T15:32:54-07:00
by fmw42
magick wrote:The random images will always differ if a seed is not specified or if two commands have different seeds (i.e. -seed 17171 and -seed 17172). If the seeds are the same, the resulting images will be the same.

If one does not set the seed and leaves it to IM to do for example with

convert -size 100x100 xc: +noise Random tmp.png

is there some way to get IM to report the seed value to the terminal, so that the same value can be used again with -seed to reproduce the same pattern?

I tried adding -verbose, but that did not report the seed value.

Re: How do I use -seed with +noise Random

Posted: 2008-12-21T16:08:18-07:00
by magick
There is no way to determine the seed value unless you set it yourself.

Re: How do I use -seed with +noise Random

Posted: 2008-12-21T16:49:35-07:00
by fmw42
magick wrote:There is no way to determine the seed value unless you set it yourself.
OK. Then any restrictions on the value that can be used for the seed? for example, must it be an integer between 0 and quantumrange?

Re: How do I use -seed with +noise Random

Posted: 2008-12-21T16:57:20-07:00
by magick
The seed can be any 32-bit value.