possible bug mpc IM 6.5.6-4 Q16 HDRI
Posted: 2009-09-24T10:55:17-07:00
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
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