This produces the a square of the same colour every time I run it:
Code: Select all
mike@mine:~$ export RANDOM=1234; convert -size 50x50 xc:red -modulate 100,50,$((RANDOM%200)) foo.png
This produces a square of a different colour every time I run it:
Code: Select all
mike@mine:~$ export RANDOM=1234; convert -size 50x50 xc:red -modulate 100,50,$((RANDOM%200)) MIFF:-|convert - foo.png
This produces a square of the same colour every time I run it:
Code: Select all
mike@mine:~$ export RANDOM=1234; convert -size 50x50 xc:"rgb($((RANDOM%255)),$((RANDOM%255)),$((RANDOM%255)))" foo.png
Code: Select all
mike@mine:~$ export RANDOM=1234; convert -size 50x50 xc:"rgb($((RANDOM%255)),$((RANDOM%255)),$((RANDOM%255)))" foo.miff;convert foo.miff foo.png
Code: Select all
mike@mine:~$ export RANDOM=1234; convert -size 50x50 xc:"rgb($((RANDOM%255)),$((RANDOM%255)),$((RANDOM%255)))" MIFF:-|convert - foo.png
Can anyone explain to me why piping MIFF:- to convert produces a random result when the other methods don't?
Code: Select all
mike@mine:~$ cat /etc/os-release
NAME=openSUSE
VERSION="13.1 (Bottle)"
VERSION_ID="13.1"
PRETTY_NAME="openSUSE 13.1 (Bottle) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:13.1"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"
mike@mine:~$ convert -version
Version: ImageMagick 6.8.6-9 2014-07-21 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jng jp2 jpeg lcms ltdl lzma pango pangocairo png png tiff webp wmf x xml zlib
mike@mine:~$