Problems with magickwand examples in branch 6.7
Problems with magickwand examples in branch 6.7
Currently I take part in building Haskell bindings for ImageMagick (mainly MagickWand).
For the starting point we took el.supremo's examples of using MagickWand (i.e. http://members.shaw.ca/el.supremo/MagickWand/ )
We do the development on Gentoo which has ImageMagick 6.7.8 as stable and we some troubles with those examples.
E.g. MagickDistortImage creates some "leaky pixel" - I get http://imgur.com/7V11F and it differs from el.supremo's result - http://members.shaw.ca/el.supremo/Magic ... fine_1.htm
MagickSetImageAlphaChannel always fails and for 'gel.c' I get http://imgur.com/xGel1 instead of http://members.shaw.ca/el.supremo/Magic ... button.htm
What is the proper way to resolve such issues?
For the starting point we took el.supremo's examples of using MagickWand (i.e. http://members.shaw.ca/el.supremo/MagickWand/ )
We do the development on Gentoo which has ImageMagick 6.7.8 as stable and we some troubles with those examples.
E.g. MagickDistortImage creates some "leaky pixel" - I get http://imgur.com/7V11F and it differs from el.supremo's result - http://members.shaw.ca/el.supremo/Magic ... fine_1.htm
MagickSetImageAlphaChannel always fails and for 'gel.c' I get http://imgur.com/xGel1 instead of http://members.shaw.ca/el.supremo/Magic ... button.htm
What is the proper way to resolve such issues?
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Problems with magickwand examples in branch 6.7
I'll try to have a look at this in the next day or so.
Pete
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: Problems with magickwand examples in branch 6.7
I tried the affine example and it does indeed produce the leaky pixels. It also slightly reduces the size of the wizard and the colours are darker in all four images. I'm using IM 6.7.5 Q16. I'll try the other example when I get around to installing the latest IM.
@magick if you want to try it, the affine distort code is here: http://members.shaw.ca/el.supremo/MagickWand/affine.htm
Pete
@magick if you want to try it, the affine distort code is here: http://members.shaw.ca/el.supremo/MagickWand/affine.htm
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
Re: Problems with magickwand examples in branch 6.7
Distort is Anthony's purview. Anthony can you explain the pixel leak?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Problems with magickwand examples in branch 6.7
The leaky pixel is NOT a leak. It is Edge replaication caused by the default Virtual Pixel Setting...
http://www.imagemagick.org/Usage/distor ... rt_virtual
and more specifically
http://www.imagemagick.org/Usage/misc/#virtual-pixel
The solution use -virtual-pxel white or -alpha set -virtual-pixel transparent or something else more appropriate to what you are trying to do.
As for the Gell example. A lot has changed, and the example may need to be checked step by step to see what is happening. It is most likely caused by some colorspace fault. probably a linear gray colorspace interaction.
http://www.imagemagick.org/Usage/distor ... rt_virtual
and more specifically
http://www.imagemagick.org/Usage/misc/#virtual-pixel
The solution use -virtual-pxel white or -alpha set -virtual-pixel transparent or something else more appropriate to what you are trying to do.
As for the Gell example. A lot has changed, and the example may need to be checked step by step to see what is happening. It is most likely caused by some colorspace fault. probably a linear gray colorspace interaction.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Problems with magickwand examples in branch 6.7
And what with MagickSetImageAlphaChannel failing? E.g. in http://members.shaw.ca/el.supremo/MagickWand/gel.htm
P.S. BTW, el_supremo, why don't you use something like github/bitbucket to publish complete compiling examples (i.e. with makefiles or whatever you use as its Windows equivalent)?
P.S. BTW, el_supremo, why don't you use something like github/bitbucket to publish complete compiling examples (i.e. with makefiles or whatever you use as its Windows equivalent)?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Problems with magickwand examples in branch 6.7
Not certian I didn't write it. But I wrote the original CLI version it is based on
IM Examples, Advanced, Gell Effects
http://www.imagemagick.org/Usage/advanced/#gel_effects
NOTE; a flag to resize the output image (and set virtual canvas offset) can also be used, especially in the 90 degree example. in CLI that is done by using +distort rather than -distort
IM Examples, Advanced, Gell Effects
http://www.imagemagick.org/Usage/advanced/#gel_effects
NOTE; a flag to resize the output image (and set virtual canvas offset) can also be used, especially in the 90 degree example. in CLI that is done by using +distort rather than -distort
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Problems with magickwand examples in branch 6.7
Anthony I have the same question to you (as to el_supremo) - are these examples you post link to available in some repository being runnable with help of e.g. makefile?
As for me It's much simpler to run git clone then make all (or some particular example name) and check the results than to start shell (or some IDE in el_supremo's case) and copy-paste commands one by one.
As for me It's much simpler to run git clone then make all (or some particular example name) and check the results than to start shell (or some IDE in el_supremo's case) and copy-paste commands one by one.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Problems with magickwand examples in branch 6.7
The examples for CLI are written directly in a HTML format text file using a plain text editor.
The command line code is extracted and run using a perl script, and image results compared with the previous results to flag possible changes or bugs that may require looking into.
This ensures that the code you see in the HTML is actually the code that was used to generate the resulting image displayed.
There is no makefile for CLI examples as such.
The command line code is extracted and run using a perl script, and image results compared with the previous results to flag possible changes or bugs that may require looking into.
This ensures that the code you see in the HTML is actually the code that was used to generate the resulting image displayed.
There is no makefile for CLI examples as such.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Problems with magickwand examples in branch 6.7
Is this script publicly available? (looking through http://trac.imagemagick.org/browser did not give me any results)anthony wrote:The examples for CLI are written directly in a HTML format text file using a plain text editor.
The command line code is extracted and run using a perl script, and image results compared with the previous results to flag possible changes or bugs that may require looking into.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Problems with magickwand examples in branch 6.7
It is on the web server, but it is not linked from anything.
Look at
http://www.imagemagick.org/Usage/generate_examples
which is the heart of the extract and execute system. It basically looks for <CODE> blocks with the special (non-standard) tag "EXECUTE" in it. Look at the HTML course of a page such as
http://www.imagemagick.org/Usage/basics/
It is launched (with other scripts) from "generate" scripts in each sub-directory.
For example
http://www.imagemagick.org/Usage/basics/generate
whcih calls various preparation scripts in the top level area, such as...
http://www.imagemagick.org/Usage/generate_options
http://www.imagemagick.org/Usage/generate_clear
http://www.imagemagick.org/Usage/generate_compare
That last is the image compare program that compares a backed up old example against the new one just generated.
Its primary goal is in the example has not really changed to keep the older example, so as to avoid uploading the changes to the offical server in the US, (I used to upload though a dialup modem, though that was a long time ago).
Yes the "generate" script could have been a makefile, but it is not so much about checking file dates, as just doing the task of extracting, generating, and comparing the examples.
Commands are run using BASH, though perl is used for the more complex scripting.
Look at
http://www.imagemagick.org/Usage/generate_examples
which is the heart of the extract and execute system. It basically looks for <CODE> blocks with the special (non-standard) tag "EXECUTE" in it. Look at the HTML course of a page such as
http://www.imagemagick.org/Usage/basics/
It is launched (with other scripts) from "generate" scripts in each sub-directory.
For example
http://www.imagemagick.org/Usage/basics/generate
whcih calls various preparation scripts in the top level area, such as...
http://www.imagemagick.org/Usage/generate_options
http://www.imagemagick.org/Usage/generate_clear
http://www.imagemagick.org/Usage/generate_compare
That last is the image compare program that compares a backed up old example against the new one just generated.
Its primary goal is in the example has not really changed to keep the older example, so as to avoid uploading the changes to the offical server in the US, (I used to upload though a dialup modem, though that was a long time ago).
Yes the "generate" script could have been a makefile, but it is not so much about checking file dates, as just doing the task of extracting, generating, and comparing the examples.
Commands are run using BASH, though perl is used for the more complex scripting.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Problems with magickwand examples in branch 6.7
Thanks a lot.
Re: Problems with magickwand examples in branch 6.7
Pete, did you look into it?el_supremo wrote:I'll try to have a look at this in the next day or so.
BTW I have found that the shell commands you show in the source code does not correspond 100% to the examples on the IM website. And in gel example I don't understand why do you use MagickFxImage instead of normal MagickSetAlphaChannel (where "-alpha" is used as command line option) and also I stumbled upon problems with ImageMagick itself - viewtopic.php?f=3&t=21921 (i.e. I get wrong images using command line examples from ImageMagick)