Bug in frame_edges example while using multithreaded?

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.
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by bram12 »

anthony wrote:Can you post a small example of the noise?

Have you tried modifying the script to output intermediate images so as to track where the noise is being added?
You Can see it yourself by doing the steps I mentioned in the previous post and also see there the different between 1 thread and 8.

I have not tried to display the intermediate results.
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by bram12 »

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

Well it is in the very early stages, The same noise pattern is repeating so it happened before the tiling. process.

But it is horizontal bands in the same image but appears after the transpose.


In fact the very next step is append the left and right images together in preparation to inserting space between them and then tiling into a '-frame' template.

As the horizontal bands do not continue to the right side, it must happen before the append.

I retested the script and it also works fine on my system. However I build with a
--disable-openmp configuration option which turns off multi-threading.

I'll try it again after removing that flag.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by bram12 »

I updated the imagemagick version to 6.4.9-8 and the following happens:
- Golden border works fine now.
- Black border still has noise.

To repeat:
- Go to http://www.freeonlinephotoeditor.com/
- Click on 'effects'
- Click on 'black frame'.

See image for example output:
Image
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

I have been playing with it and it seems that particular set of images has all the problems. Though bamboothin also seems to have problems...

Investigating.

PS: I have already improved the scritp with better usage output and listing the edging image styles available.

PPS: Now would be a good time to add new framing edging images.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

It is a highly variable problem that depends a lot on when and where commands are run. It is likely caused by multi-threading, however when the problem is happening, using MAGICK_THREAD_LIMIT=1 does NOT help!

I will try to isolate the problem further, but it is like a slippy fish, dissappearing as a smallest change.


I have re-packaged my changes to the script, and it will appear on the main site in a day or too. look for the file date change in the scripts area
http://www.imagemagick.org/Usage/scripts/


The script can now automatically accommodate new edging images being added to the edge_images/ sub-directory, and in fact most 'styles' are handled automatically in that way. Though for some edges tweeking the 'style' colors, or top to bottom conversion method, may be a good idea. More comments have been added to the script, as to the meaning of the style control variables.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

Further isolation of the bug.

download from the IM images area a blackthin images and convert to png

Code: Select all

convert http://www.imagemagick.org/Usage/images/blackthin_top.gif t.png
Now load two copys and splice, and the problem appears for the second image!

Code: Select all

convert -background none t.png t.png   -splice 0x84+0+0 show:
The first image shown is fine, the second has become randomly transparent!!!!

But only with this exact command, any attempt to make it simpler, such as remove the first image, makes the problem disappear.

Also substituting a PNG format copy of the rose: image also makes the problem disappear. I think the GIF to PNG converted image may be important.

Adding the MAGICK_THREAD_LIMIT=1 does not fix the problem so it may not be a multi-threading problem but an initialization problem.

Cristy, please have a look...
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by magick »

We can reproduce the problem you posted and have a patch. Look for it in ImageMagick 6.4.9-9 Beta by sometime tomorrow.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

While my specific test now succeeds, the problem has not been fixed!

Looking....
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

While my previous test now succeeds, the problem has not been fixed!

Simplifying again, this time it is while appending two images.

download from the IM images area a blackthin images and convert to png

Code: Select all

convert http://www.imagemagick.org/Usage/images/blackthin_top.gif t.png
Now append the image twice and problem appears for the appended image in the result.

Code: Select all

convert -background none t.png t.png  -append show:
As before two image are required to generate the problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

IM is now fixed with every frame I have tried. As mentioned before I also updated the framing script to be better and to handle straight addition of new frame edge images to the edge_image sub-directory.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
bram12
Posts: 14
Joined: 2008-10-14T02:40:20-07:00

Re: Bug in frame_edges example while using multithreaded?

Post by bram12 »

Thx. everything seems to work ok now.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Bug in frame_edges example while using multithreaded?

Post by anthony »

If you come up with some new framing edge images, please contribute back to me :-)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply