Problems with magickwand examples in branch 6.7

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
qrilka
Posts: 9
Joined: 2012-08-04T03:06:38-07:00
Authentication code: 67789

Problems with magickwand examples in branch 6.7

Post by qrilka »

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?
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Problems with magickwand examples in branch 6.7

Post by el_supremo »

I'll try to have a look at this in the next day or so.

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.
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Problems with magickwand examples in branch 6.7

Post by el_supremo »

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
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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problems with magickwand examples in branch 6.7

Post by magick »

Distort is Anthony's purview. Anthony can you explain the pixel leak?
User avatar
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

Post by anthony »

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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
qrilka
Posts: 9
Joined: 2012-08-04T03:06:38-07:00
Authentication code: 67789

Re: Problems with magickwand examples in branch 6.7

Post by qrilka »

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)?
User avatar
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

Post by anthony »

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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
qrilka
Posts: 9
Joined: 2012-08-04T03:06:38-07:00
Authentication code: 67789

Re: Problems with magickwand examples in branch 6.7

Post by qrilka »

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.
User avatar
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

Post by anthony »

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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
qrilka
Posts: 9
Joined: 2012-08-04T03:06:38-07:00
Authentication code: 67789

Re: Problems with magickwand examples in branch 6.7

Post by qrilka »

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.
Is this script publicly available? (looking through http://trac.imagemagick.org/browser did not give me any results)
User avatar
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

Post by anthony »

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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
qrilka
Posts: 9
Joined: 2012-08-04T03:06:38-07:00
Authentication code: 67789

Re: Problems with magickwand examples in branch 6.7

Post by qrilka »

Thanks a lot.
qrilka
Posts: 9
Joined: 2012-08-04T03:06:38-07:00
Authentication code: 67789

Re: Problems with magickwand examples in branch 6.7

Post by qrilka »

el_supremo wrote:I'll try to have a look at this in the next day or so.
Pete, did you look into it?
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)
Post Reply