convert the same image

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

convert the same image

Post by chanoy » 2007-02-07T10:24:02-07:00


I'm just curious on how convert will work if I convert an image to a different location with the same extension. Will the algorithm knows that no conversion is needed, and thus just copy the file to the other location?

For example,
"convert af1.pgm ./temp/af1.pgm"

A simple test tells me that it will create the af1.pgm in temp directory, but I'm just wondering if the algorithm just do a file copy or actually "converts" it (which takes more time, more calculations, and same result)?


User avatar
Site Admin
Posts: 10962
Joined: 2003-05-31T11:32:55-07:00

Re: convert the same image

Post by magick » 2007-02-07T10:31:40-07:00

If you convert an image onto itself, the convert program will read the image file and then write it back out to the same image file location.

User avatar
Posts: 8882
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert the same image

Post by anthony » 2007-02-07T21:28:12-07:00

Of course some image formats will thus change. JPEG will have some image compression degrading, PNG might be saved in a different style (basied on content), and some formats include date information.

I suggest you actually copy when you mean copy.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages

Post Reply