error with multiple filenames

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
jbeale
Posts: 8
Joined: 2007-12-07T11:15:22-07:00

error with multiple filenames

Post by jbeale »

I'm running WinXP SP3. Imagemagick works as expected, when converting individual images, but when I try to operate on a set of images at once, I get a strange error. (note, "hnames.txt" is a list of image filenames). Any suggestions?

Code: Select all

C:\test>composite base.png test1.gif -compose darken out001.png         # <-- works as expected

C:\test>composite base.png @hnames.txt -compose darken out%03d.png
composite: unable to open image `magick': No such file or directory @ error/blob.c/OpenBlob/2498.
composite: no decode delegate for this image format `magick' @ error/constitute.c/ReadImage/532.

C:\test>composite --version
Version: ImageMagick 6.6.2-5 2010-06-09 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: error with multiple filenames

Post by magick »

We can reproduce this problem and will have a patch in ImageMagick 6.6.3-0 Beta by sometime tomorrow. Thanks.
jbeale
Posts: 8
Joined: 2007-12-07T11:15:22-07:00

Re: error with multiple filenames

Post by jbeale »

magick wrote:We can reproduce this problem and will have a patch in ImageMagick 6.6.3-0 Beta by sometime tomorrow. Thanks.
Wow! Never expected that on a holiday weekend- thanks for the extremely prompt response! Looking forward to trying the patch. -John
jbeale
Posts: 8
Joined: 2007-12-07T11:15:22-07:00

Re: error with multiple filenames

Post by jbeale »

I attempted to compile IM 6.6.3.1 beta using MS Visual Studio 2010 Express, but was unable to. A quick google of the error message suggests that the "Express" version of Visual Studio is inadequate for this job, and I don't have the full version. Is there a place to get a precompiled Win32 version, or should I just wait for a regular release?

142>c:\documents and settings\john\my documents\downloads\imagemagick-6.6.3-1-windows\imagemagick-6.6.3\win2k\imdisplay\stdafx.h(15): fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: error with multiple filenames

Post by magick »

You can build most ImageMagick applications with Visual Express. Just skip imdisplay and ImageMagickObject.

The patch you're looking for should be in the Imagemagick 6.6.3-0 Windows binary distribution.
jbeale
Posts: 8
Joined: 2007-12-07T11:15:22-07:00

Re: error with multiple filenames

Post by jbeale »

Thanks again for the prompt help. Ok, 6.6.3.0 is installed, but I may have a basic usage confusion.

What I have is a large number of files, hist0000.gif, hist0001.gif, hist0002.gif and so forth, and one mask file MASK.png and I want to generate a set of matching output files OUT001.png, OUT002.png, OUT003.png and so forth, using something like one of these lines

composite hist%04d.gif MASK.png -compose darken "OUT%03d.png"
composite *.gif MASK.png -compose darken "OUT%03d.png"
composite @fname.txt MASK.png -compose darken "OUT%03d.png"

(where fname.txt is a list of the *.gif files, one per line).... but none of these things work. With the new 6.6.3.0 version I don't get an error, but at most I get a single file converted, not the entire set. Any tips on doing this kind of multiple-file processing?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: error with multiple filenames

Post by fmw42 »

I think you will have to write a script loop. I don't think IM can process more than one image with a common image in a composite operation. You also left out the -composite. You need

convert oneimage maskimage -compose darken -composite resultimage

see http://www.imagemagick.org/Usage/compose/#compose

but you can do

convert image1 image2 image3 ... imageN -compose darken -layers merge resultimage

This latter will take the darkest value for each pixel from among each of the N input images.

mogrify will process a whole directory of image, but I don't think it allows a second image in the processing sequence.
Post Reply