I was working on a script and happened to be in HDRI mode and came accross the following issue that only happens when using MPC (for temp files in the script). I don't know if this is an issue with MPC, gradient creation, or -black-threshold & -white-threshold all under HDRI. So possibly some resolution issue under HDRI?
I have extracted the basic area where the problem happens.
This works just fine with PNG format:
# create gradient
blackpt=15934
whitept=49344
convert -size 20x256 gradient: -rotate 90 grad256x20a.png
# threshold a range of values
convert grad256x20a.png \
\( -clone 0 -white-threshold $blackpt \
-channel rgba -alpha on -fill none -opaque white \) \
\( -clone 0 -black-threshold $whitept \
-channel rgba -alpha on -fill none -opaque black \) \
-delete 0 -compose over -composite \
-fill white +opaque none \
-fill black -opaque none \
-alpha off \
grad256x20_b15934_w49344a.png
But when I use MPC images (and then convert to PNG so I can display them here), I get spotty thresholding that I don't understand. Perhaps Magick can shed some light on this.
# create gradient
blackpt=15934
whitept=49344
convert -size 20x256 gradient: -rotate 90 grad256x20.mpc
convert grad256x20.mpc grad256x20b.png
# threshold a range of values
convert grad256x20.mpc \
\( -clone 0 -white-threshold $blackpt \
-channel rgba -alpha on -fill none -opaque white \) \
\( -clone 0 -black-threshold $whitept \
-channel rgba -alpha on -fill none -opaque black \) \
-delete 0 -compose over -composite \
-fill white +opaque none \
-fill black -opaque none \
-alpha off \
grad256x20_b15934_w49344.mpc
convert grad256x20_b15934_w49344.mpc grad256x20_b15934_w49344b.png
Note this spotty issue is visible in the MPC file and not an issue of converting to PNG.
Thanks
possible bug mpc IM 6.5.6-4 Q16 HDRI
Re: possible bug mpc IM 6.5.6-4 Q16 HDRI
We can reproduce the problem you reported and have a patch in ImageMagick 6.5.6-5 beta available sometime later today. Thanks.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug mpc IM 6.5.6-4 Q16 HDRI
I cannot install the 6.5.6-5 Q16 beta as HDRI successfully. Here is the error:
Running Mkbootstrap for Image::Magick ()
chmod 644 Magick.bs
rm -f blib/arch/auto/Image/Magick/Magick.bundle
LD_RUN_PATH="/Users/fred/Applications/ImageMagick-6.5.6-5betasource/PerlMagick/../magick/.libs:/Users/fred/Applications/ImageMagick-6.5.6-5betasource/PerlMagick/../wand/.libs" gcc -std=gnu99 -L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand -bundle -undefined dynamic_lookup -L/usr/local/lib -L/Users/fred/Applications/ImageMagick-6.5.6-5betasource/magick -L/Users/fred/Applications/ImageMagick-6.5.6-5betasource/wand -L/usr/X11R6/lib -L/usr/local/lib -lfreetype -lz Magick.o -o blib/arch/auto/Image/Magick/Magick.bundle -L/Users/fred/Applications/ImageMagick-6.5.6-5betasource/PerlMagick/../magick/.libs -lMagickCore -L/Users/fred/Applications/ImageMagick-6.5.6-5betasource/PerlMagick/../wand/.libs -lMagickWand -lm
/usr/bin/ld: flag: -undefined dynamic_lookup can't be used with MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
collect2: ld returned 1 exit status
make[3]: *** [blib/arch/auto/Image/Magick/Magick.bundle] Error 1
make[2]: *** [install-exec-perl] Error 2
make[1]: *** [install-am] Error 2
make: *** [install] Error 2
Is this just a PerlMagick problem?
Attempting to verify.
OK. Processing seems to work.
Now I get:
blackpt=15934
whitept=49344
convert -size 20x256 gradient: -rotate 90 grad256x20.mpc
convert grad256x20.mpc grad256x20c.png
convert grad256x20.mpc \
\( -clone 0 -white-threshold $blackpt \
-channel rgba -alpha on -fill none -opaque white \) \
\( -clone 0 -black-threshold $whitept \
-channel rgba -alpha on -fill none -opaque black \) \
-delete 0 -compose over -composite \
-fill white +opaque none \
-fill black -opaque none \
-alpha off \
grad256x20_b15934_w49344.mpc
convert grad256x20_b15934_w49344.mpc grad256x20_b15934_w49344c.png
which looks fine and the mpc file also displays fine
Thanks.
Fred
Running Mkbootstrap for Image::Magick ()
chmod 644 Magick.bs
rm -f blib/arch/auto/Image/Magick/Magick.bundle
LD_RUN_PATH="/Users/fred/Applications/ImageMagick-6.5.6-5betasource/PerlMagick/../magick/.libs:/Users/fred/Applications/ImageMagick-6.5.6-5betasource/PerlMagick/../wand/.libs" gcc -std=gnu99 -L../magick/.libs -lMagickCore -L../wand/.libs -lMagickWand -bundle -undefined dynamic_lookup -L/usr/local/lib -L/Users/fred/Applications/ImageMagick-6.5.6-5betasource/magick -L/Users/fred/Applications/ImageMagick-6.5.6-5betasource/wand -L/usr/X11R6/lib -L/usr/local/lib -lfreetype -lz Magick.o -o blib/arch/auto/Image/Magick/Magick.bundle -L/Users/fred/Applications/ImageMagick-6.5.6-5betasource/PerlMagick/../magick/.libs -lMagickCore -L/Users/fred/Applications/ImageMagick-6.5.6-5betasource/PerlMagick/../wand/.libs -lMagickWand -lm
/usr/bin/ld: flag: -undefined dynamic_lookup can't be used with MACOSX_DEPLOYMENT_TARGET environment variable set to: 10.1
collect2: ld returned 1 exit status
make[3]: *** [blib/arch/auto/Image/Magick/Magick.bundle] Error 1
make[2]: *** [install-exec-perl] Error 2
make[1]: *** [install-am] Error 2
make: *** [install] Error 2
Is this just a PerlMagick problem?
Attempting to verify.
OK. Processing seems to work.
Now I get:
blackpt=15934
whitept=49344
convert -size 20x256 gradient: -rotate 90 grad256x20.mpc
convert grad256x20.mpc grad256x20c.png
convert grad256x20.mpc \
\( -clone 0 -white-threshold $blackpt \
-channel rgba -alpha on -fill none -opaque white \) \
\( -clone 0 -black-threshold $whitept \
-channel rgba -alpha on -fill none -opaque black \) \
-delete 0 -compose over -composite \
-fill white +opaque none \
-fill black -opaque none \
-alpha off \
grad256x20_b15934_w49344.mpc
convert grad256x20_b15934_w49344.mpc grad256x20_b15934_w49344c.png
which looks fine and the mpc file also displays fine
Thanks.
Fred