Page 1 of 1
Solved: Merging 200+ transparent images
Posted: 2015-07-31T06:54:38-07:00
by tEAm5PYX
I have images of all countries in the world. They have exactly the same size and are transparent except for the area with the country. I colorize the countries and then merge the images together to get one image that retains the transparency.
The command I use for merging:
Code: Select all
convert -layers merge -background none countries/* output.png
This works well, but sometimes the output file has a black line somewhere in the image, as shown here:
I guess this is a bug, but I haven't found a way to reproduce it.
Is there any way to work around this by using another command to merge the images?
Re: Merging 200+ transparent images
Posted: 2015-07-31T07:00:06-07:00
by magick
We assume you're running under Linux. Do you have the latest release of ImageMagick, 6.9.1-10? Does it still reproduce the problem? If so, it may be a problem with libgomp, the OpenMP implementation. Try building ImageMagick without OpenMP support:
- cd ImageMagick-6.9.1-10
./configure --disable-openmp
make install
Rerun your merge. Does the line appear anymore? If so, it could be that some of your images are not fully transparent. If you blend two images that are not fully transparent, a line could appear.
Re: Merging 200+ transparent images
Posted: 2015-07-31T08:03:12-07:00
by tEAm5PYX
Thanks for the quick answer! Yes, I'm running Ubuntu Server 14.04 and ImageMagick version 6.9.1-6. I tried the merge command several times with the same images and the black line was only in some of the output files, so I can rule out the images as error source.
I'll try installing the latest version with the configuration you suggested.
Re: Merging 200+ transparent images
Posted: 2015-08-03T01:24:46-07:00
by tEAm5PYX
I installed the latest version without OpenMP
Code: Select all
Version: ImageMagick 6.9.1-10 Q16 x86_64 2015-07-31 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC
Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr lzma openexr pangocairo png tiff wmf x xml zlib
but it still happens:
About 5-10% of the merged images end up like this. The Y position varies, but the line always starts at exactly the same X position.
Re: Merging 200+ transparent images
Posted: 2015-08-03T04:12:39-07:00
by magick
Before we could comment further, we would need to reproduce the problem so we can trace it. Post a URL to your images and the command set needed to reproduce the problem. Its likely a data driven problem rather than a bug but unless we can reproduce the problem, we can't say for sure.
Re: Merging 200+ transparent images
Posted: 2015-08-26T06:15:52-07:00
by tEAm5PYX
I was also using memory and map limits and set them lower than the defaults. It seems that was the cause of this. I removed the limits and haven't seen this problem again.