IM 6.6.0-6 - New setting ignored when resetting a mask
Posted: 2010-03-17T09:24:37-07:00
Hello !
With convert, resetting -mask by reusing the filename of a modified file fails to take the modification into account.
Whilst writing IM commands, I've taken the habit to overwrite my mpr: files when possible so as to hopefully minimize the memory required and not have to hit the o so slower disk with temporary files ; far from being always necessary, I nonetheless consider it a good automatism to have considering how fast things can add up : an oversampling here and there for example and all of a sudden we speak hundreds of megabytes after all.
With regard to the setting and resetting of -mask, doing this worked well in IM 6.4.9-3 2009-02-05 Q8 on Windows XPSP3, but leads to failure in IM 6.6.0-6 2010-03-16 Q16 OpenMP on both Ubuntu 9.10 and Windows XPSP3, as shown by this test :
In a single command,(Edit: every "tile:pattern:" replaced by the sufficient "pattern:" so as not to set a bad example)
Note: The URLs of the following images are posted here in plain text and not in BBcode because for whatever reason, when editing and previewing this post, instead of being displayed, these URLs were redirected to "bayimg.com" (?!?) whereas the embedding seemed to work well when tried with the logos of (and hosted on) ImageMagick or Wikipedia. Sorry for the inconvenience.
fading_1.png should have been :
http://pixfarm.net/upload/1/originals/a8/a8718f931f7a58b885840748287c8af1.png
.. and it was, as expected ; mpr:grayscale was correctly taken into account the first time it was used.
fading_2.png should have been :
http://pixfarm.net/upload/2/originals/66/66d6f2f271ebfbe36bdd5818def635e6.png
.. instead, it was :
http://pixfarm.net/upload/2/originals/a5/a5e7a22c68d5c558ab82c7cb679bfc8a.png
.. it did not fade ; not only that : convert complained that "image size differs" as if mpr:grayscale had not been modified.
Now, considering that -transpose works well, either overwriting mpr:grayscale failed or the second -mask ignored the modified content of mpr:grayscale.
Having otherwise verified that overwriting a mpr: still worked, it appears that resetting -mask fails when the filename used is unchanged, even if the content of the said file has changed.
Inserting a +mask beforehand being of no avail, a way to cope with the bug was here to create a differently named mpr: for each reset of -mask.
Side note : in the documentation, as of 2010-03-16, -mask is listed as an operator whereas it already appears among the settings.
Thanks for your attention !
With convert, resetting -mask by reusing the filename of a modified file fails to take the modification into account.
Whilst writing IM commands, I've taken the habit to overwrite my mpr: files when possible so as to hopefully minimize the memory required and not have to hit the o so slower disk with temporary files ; far from being always necessary, I nonetheless consider it a good automatism to have considering how fast things can add up : an oversampling here and there for example and all of a sudden we speak hundreds of megabytes after all.
With regard to the setting and resetting of -mask, doing this worked well in IM 6.4.9-3 2009-02-05 Q8 on Windows XPSP3, but leads to failure in IM 6.6.0-6 2010-03-16 Q16 OpenMP on both Ubuntu 9.10 and Windows XPSP3, as shown by this test :
In a single command,
- a grayscale image was used to set a mask,
- it was modified,
- it was then used to reset the mask.
Code: Select all
convert \
-size 123x456 \
gradient:white-black \
-write mpr:grayscale +delete \
-mask mpr:grayscale \
pattern:bricks pattern:checkerboard \
-compose SrcOver -composite \
-write fading_1.png +delete \
mpr:grayscale \
-transpose \
-write mpr:grayscale +delete \
-mask mpr:grayscale -size 456x123 \
pattern:bricks pattern:checkerboard \
-compose SrcOver -composite \
fading_2.png
Note: The URLs of the following images are posted here in plain text and not in BBcode because for whatever reason, when editing and previewing this post, instead of being displayed, these URLs were redirected to "bayimg.com" (?!?) whereas the embedding seemed to work well when tried with the logos of (and hosted on) ImageMagick or Wikipedia. Sorry for the inconvenience.
fading_1.png should have been :
http://pixfarm.net/upload/1/originals/a8/a8718f931f7a58b885840748287c8af1.png
.. and it was, as expected ; mpr:grayscale was correctly taken into account the first time it was used.
fading_2.png should have been :
http://pixfarm.net/upload/2/originals/66/66d6f2f271ebfbe36bdd5818def635e6.png
.. instead, it was :
http://pixfarm.net/upload/2/originals/a5/a5e7a22c68d5c558ab82c7cb679bfc8a.png
.. it did not fade ; not only that : convert complained that "image size differs" as if mpr:grayscale had not been modified.
Now, considering that -transpose works well, either overwriting mpr:grayscale failed or the second -mask ignored the modified content of mpr:grayscale.
Having otherwise verified that overwriting a mpr: still worked, it appears that resetting -mask fails when the filename used is unchanged, even if the content of the said file has changed.
Inserting a +mask beforehand being of no avail, a way to cope with the bug was here to create a differently named mpr: for each reset of -mask.
Side note : in the documentation, as of 2010-03-16, -mask is listed as an operator whereas it already appears among the settings.
Thanks for your attention !