source code for "convert.exe"

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Pravin

source code for "convert.exe"

Post by Pravin »

Hi,

Is source code for "convert.exe" is available? I want to use ImageMagicK from .net code (not using command line utility) covering all functionality. it will be great if I get source code of "convert.exe".

Thanks.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: source code for "convert.exe"

Post by magick »

You can find the ImageMagick source from the web site, http://www.imagemagick.org.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: source code for "convert.exe"

Post by anthony »

I suggest you download a subversion copy of the source, as it will contain the most up-to-date additions that developers (such as myself) are working on, and allow you to join in discussions about things.

If you are looking for how a particular operation is performed, I would start by searching for that 'option' in the file "wand/mogrify.c" which is used by both mogrify and convert.

Almost all operation calls (for example "CompositeImage()") can then be looked up in the ".h" files in the "magick" sub-directory, and the actual function in the corresponding ".c" file.

Do not bother to try and trace the exact path of "convert" itself, as you will probably get lost.


Is there something of particular interest?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
saminpa
Posts: 1
Joined: 2016-11-19T09:37:21-07:00
Authentication code: 1151

Re: source code for "convert.exe"

Post by saminpa »

I realize this is a very old post but it lives on Google and might help the next person who's looking for an answer.

All I wanted to do was figure out how to handle stride correctly in a bmp when given a RGB stream that wasn't working right in my code and I was looking at this massive repository wondering where to look to see what I was doing wrong... (being stupid and illogical because the source was padded with zeros at the end that made the packed RGB the size of bmp data with stride already included for some bizarre reason)

The answer in three steps if you have visual studio (or can download the community edition for free, I think)

1. Get the source (I found ImageMagick-7.0.3-7)
2. Load and run the project ImageMagick-7.0.3-7\VisualMagick\configure\configure.sln. This will build/setup the actual VS solution according to your specifications, VisualDynamicMT.sln according to my default selections (I did specifically set the checkbox for legacy components since I believe convert has been superseded)
3. Select UTIL_magick as the default (executable) project with "-depth 8 -size 3422x2636 C:\Temp\in.rgb C:\Temp\out.bmp" without the quotes in project configuration settings/debugging/command arguments and step through the code in the debugger

The code matches your arguments to a pattern and will use the file extensions to figure out what you want to do.

Of course Step 0 is to read some of the documentation but you don't need a whole lot of information to get started. Hth.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: source code for "convert.exe"

Post by snibgo »

Code that is specific to reading or writing a format will be found in the "coders" directory, eg "coders/bmp.c".
snibgo's IM pages: im.snibgo.com
Post Reply