Best way to use Imagemagick

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
Poncho

Best way to use Imagemagick

Post by Poncho »

Hi,

I'm new to C++ and I have written a program (with GUI in Visual Studio 2008) to use imagemagick as an .exe with system(), however this is slow and not very effective.

Now I would like to include imagemagick into my program or use .dll or something like that to use imagemagick, but I don't know how to do that and don't know what is best way. I would like to use imagemagick as a function. Like imagemagick::convert(), is that possible?

Can someone tell me how to do this or know tutorial that can help me?

Sorry, if this is asked before.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Best way to use Imagemagick

Post by magick »

Look in c:\Program Files\ImageMagick-6.5.9-Q16\Magick++_demos for the Button workspace. Click on it, build, and execute. Assuming all goes well, use this as a template for your own custom Magick++ project.
Poncho

Re: Best way to use Imagemagick

Post by Poncho »

Thank you, I made some demo .exe's and it looks nice, however I want to distribute my program and not everybody has imagemagick on the pc (in fact probably no one has it on the pc).

How can I fix this? How can I ship imagemagick with my own program?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Best way to use Imagemagick

Post by magick »

Your users can download / install ImageMagick or you can distribute the portable ImageMagick Windows distribution (see http://www.imagemagick.org/script/binar ... hp#windows) with your project.
Poncho

Re: Best way to use Imagemagick

Post by Poncho »

I already use the portable ImageMagick, but how do I link to the portable ImageMagick Windows distribution in the demo .exe's? How can I tell where the program can find the convert.exe and composite.exe?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Best way to use Imagemagick

Post by magick »

Perhaps another user can help. We know you can link against the dynamic binary of ImageMagick (see the Button workspace) but we have not tried to link against the portable static release. ImageMagick determines where the configuration files are located based on the path of the convert executable. You can also set the MAGICK_HOME environment variable.
Poncho

Re: Best way to use Imagemagick

Post by Poncho »

I don't need to use portable static release, I can also use dynamic binary, but I don't know what it is or how it works. :(

I would like my program .exe to be in folder with readme.txt and in other folder called imagemagick I put all the stuff needed for imagemagick to work. How can I let my program (written in C++) find the needed files to do +append etc. in the imagemagick folder? The images are in other folder next to imagemagick called alphabet.

edit: for using imagemagick with windows command there is a nice webpage/tutorial but I don't know any for this stuff... :(
Post Reply