Re: Mogrify vs. Convert

Bob Friesenhahn <[email protected]> Wed, 9 Apr 2003 21:23:41 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.tools
Message-ID <Pine.GSO.4.44.0304092113410.14826-100000@scooby.simplesystems.org>
On Wed, 9 Apr 2003, Noah Spurrier wrote:

> But mogrify also has the -format option which makes
> it function like the convert command (save to new file).
> If you added the ability for Convert to overwrite the original file then
> I don't see any need for Mogrify at all. Convert does everything
> that Mogrify does and a little bit more (actually, you would have to
> add -linewidth too, but that's the only thing Convert seems to lack).
> Unless I'm still missing something, the differences between the
> two commands are so minor.

The differences are much greater than they appear on the surface.
The mogrify command preserves the original organization of multi-frame
images (e.g. animations) while convert will collect all of the frames
from multiple files together and put them in a single file.

It is quite true that 99% of the command parsing is the same.  The
main difference is what happens when a file is encountered.

> It seems like they must have had difference origins
> and then slowly evolved toward the same functionality.
> Do they have different code bases (not counting the libraries)?

In ImageMagick these are seperate executables.  Until recent times,
these executables did have independent and fairly large source modules
associated with them.  Now the command parsers are lumped together
into one huge source file (command.c), but are still independent
command parsers.  The command parsers are now included in the
GraphicsMagick library. This lumping together was done so that
ImageMagickObject would be able to invoke the command parsers.

I agree that this is not a good design.  GraphicMagick needs a
volunteer to develop a new rules-based command-line parsing engine to
replace all of the current command parsers.  The parsing engine should
work based on a high-level syntax specification (perhaps based on XML)
in order to ease maintenance.  Note that this is a challenging task
since the end result must be 100% compatable with the current
interfaces.

Bob

> ----- Original Message -----
> From: "Bob Friesenhahn" <[email protected]>
> To: <[email protected]>
> Sent: Wednesday, April 09, 2003 11:53 AM
> Subject: Re: [GM-tools] Mogrify vs. Convert
>
>
> > The crucial difference is that with mogrify "the transmogrified image
> > overwrites the original image" whereas convert "converts an input file
> > using one image format to an output file with a differing image
> > format".  Convert also has the capability to transform multiple images
> > into a multi-frame image file so it can be used to create animations.
> >
> > Bob
> >
> > On Wed, 9 Apr 2003, Noah Spurrier wrote:
> >
> > > Hi,
> > >
> > > What is the motive behind the difference between Mogrify and Convert?
> > > Their descriptions do not make it clear when one should be used
> > > versus another. The fact that their commands differ in only a few places
> > > adds to the confusion. This is how I read the documentation:
> > >
> > >         Mogrify -- "Transforms image(s) with optional conversions."
> > >         Convert -- "Converts image(s) with optional transformations."
> > >
> > > If there is some crucial difference in these two tools then
> > > it would be great to see this made clear in the documentation. If not,
> > > then perhaps in future versions one could become an alias for the other
> > > (to preserve existing scripts).
> > >
> > > Yours,
> > > Noah
> > >
> > > Note, from the documentation we can see how similar they are.
> > >
> > > Mogrify                                Convert
> > > -------------------------------------------------------------------------
> > > transforms an image or a sequence      converts an input file using
> > > of images. These transforms include    one image format to an output file
> > > image scaling, image rotation, color   with a differing image format.
> > > reduction, and others.                 In addition, various types of
> > > The transmogrified image overwrites    image processing can be performed
> > > the original image, unless an          on the converted image during the
> > > option such as -format causes the      conversion process.
> > > output filename to be different
> > > from the input filename.
> > > ----------------------------            ---------------------
> > >   -Gaussian                               -Gaussian
> > >                                           -adjoin
> > >   -affine                                 -affine
> > >   -antialias                              -antialias
> > >                                           -append
> > >   -authenticate                           -authenticate
> > >                                           -average
> > >   -background                             -background
> > >   -blue-primary                           -blue-primary
> > >   -blur                                   -blur
> > >   -border                                 -border
> > >   -bordercolor                            -bordercolor
> > >                                           -box
> > >   -cache                                  -cache
> > >   -channel                                -channel
> > >   -charcoal                               -charcoal
> > >                                           -chop
> > >                                           -clip
> > >                                           -coalesce
> > >   -colorize                               -colorize
> > >   -colors                                 -colors
> > >   -colorspace                             -colorspace
> > >   -comment                                -comment
> > >   -compose                                -compose
> > >   -compress                               -compress
> > >   -contrast                               -contrast
> > >   -crop                                   -crop
> > >   -cycle                                  -cycle
> > >   -debug                                  -debug
> > >                                           -deconstruct
> > >   -delay                                  -delay
> > >   -density                                -density
> > >   -depth                                  -depth
> > >   -despeckle                              -despeckle
> > >   -display                                -display
> > >   -dispose                                -dispose
> > >   -dither                                 -dither
> > >   -draw                                   -draw
> > >   -edge                                   -edge
> > >   -emboss                                 -emboss
> > >   -encoding                               -encoding
> > >   -endian                                 -endian
> > >   -enhance                                -enhance
> > >   -equalize                               -equalize
> > >   -fill                                   -fill
> > >   -filter                                 -filter
> > >                                           -flatten
> > >   -flip                                   -flip
> > >   -flop                                   -flop
> > >   -font                                   -font
> > >   -format
> > >   -frame                                  -frame
> > >   -fuzz                                   -fuzz
> > >   -gamma                                  -gamma
> > >   -geometry                               -geometry
> > >   -gravity                                -gravity
> > >   -green-primary                          -green-primary
> > >   -help                                   -help
> > >   -implode                                -implode
> > >                                           -intent
> > >   -interlace                              -interlace
> > >   -label                                  -label
> > >   -lat                                    -lat
> > >   -level                                  -level
> > >   -limit                                  -limit
> > >   -linewidth
> > >   -list                                   -list
> > >   -log                                    -log
> > >   -loop                                   -loop
> > >   -map                                    -map
> > >   -mask                                   -mask
> > >   -matte                                  -matte
> > >   -mattecolor                             -mattecolor
> > >   -median                                 -median
> > >   -modulate                               -modulate
> > >   -monochrome                             -monochrome
> > >                                           -morph
> > >                                           -mosaic
> > >   -negate                                 -negate
> > >   -noise                                  -noise
> > >   -noop                                   -noop
> > >   -normalize                              -normalize
> > >   -opaque                                 -opaque
> > >   -page                                   -page
> > >   -paint                                  -paint
> > >   -pen                                    -pen
> > >                                           -ping
> > >   -pointsize                              -pointsize
> > >                                           -preview
> > >                                           -process
> > >   -profile                                -profile
> > >   -quality                                -quality
> > >   -raise                                  -raise
> > >   -red-primary                            -red-primary
> > >   -region                                 -region
> > >   -resize                                 -resize
> > >   -roll {+-}                              -roll {+-}
> > >   -rotate                                 -rotate
> > >   -sample                                 -sample
> > >   -sampling-factor                        -sampling-factor
> > >   -scale                                  -scale
> > >   -scene                                  -scene
> > >   -seed                                   -seed
> > >   -segment                                -segment
> > >   -shade                                  -shade
> > >   -sharpen                                -sharpen
> > >   -shave                                  -shave
> > >   -shear                                  -shear
> > >   -size                                   -size
> > >   -solarize                               -solarize
> > >   -spread                                 -spread
> > >   -stroke                                 -stroke
> > >   -strokewidth                            -strokewidth
> > >   -swirl                                  -swirl
> > >   -texture                                -texture
> > >   -threshold                              -threshold
> > >   -tile                                   -tile
> > >   -transform                              -transform
> > >   -transparent                            -transparent
> > >   -treedepth                              -treedepth
> > >   -trim                                   -trim
> > >   -type                                   -type
> > >   -units                                  -units
> > >   -unsharp                                -unsharp
> > >                                           -use-pixmap
> > >   -verbose                                -verbose
> > >   -version                                -version
> > >   -view                                   -view
> > >   -virtual-pixel                          -virtual-pixel
> > >   -wave                                   -wave
> > >   -white-point                            -white-point
> > >                                           -write
> > >
> > >
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
> > > for complex code. Debugging C/C++ programs can leave you feeling lost and
> > > disoriented. TotalView can help you find your way. Available on major UNIX
> > > and Linux platforms. Try it free. www.etnus.com
> > > _______________________________________________
> > > Graphicsmagick-tools mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/graphicsmagick-tools
> > >
> >
> > ======================================
> > Bob Friesenhahn
> > [email protected]
> > http://www.simplesystems.org/users/bfriesen
> >
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
> > for complex code. Debugging C/C++ programs can leave you feeling lost and
> > disoriented. TotalView can help you find your way. Available on major UNIX
> > and Linux platforms. Try it free. www.etnus.com
> > _______________________________________________
> > Graphicsmagick-tools mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/graphicsmagick-tools
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger
> for complex code. Debugging C/C++ programs can leave you feeling lost and
> disoriented. TotalView can help you find your way. Available on major UNIX
> and Linux platforms. Try it free. www.etnus.com
> _______________________________________________
> Graphicsmagick-tools mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/graphicsmagick-tools
>

======================================
Bob Friesenhahn
[email protected]
http://www.simplesystems.org/users/bfriesen



-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com