Page 1 of 1

Conversion TIFF to PNG, TIFF to JPG

Posted: 2016-06-20T04:13:56-07:00
by Minary
Hi,

Would someone be able to tell how how the conversion from TIFF to PNG, and TIFF to JPG is done in ImageMagick?

I tried looking in the documents but could not find how it is implemented.

Regards
Minary

Re: Conversion TIFF to PNG, TIFF to JPG

Posted: 2016-06-20T04:26:59-07:00
by snibgo
Your question is vague. Perhaps you mean, "What is the command to convert from TIFF to PNG, etc?" Then the answer is:

Code: Select all

convert in.tiff out.png
Or perhaps you want to know how the magick works? It is open source, so you can see all the internals.

Re: Conversion TIFF to PNG, TIFF to JPG

Posted: 2016-06-20T04:34:41-07:00
by Minary
Thank you for the reply!

It is how the magick works I would like to know. I will try to find the right place in the code, but have limited experience with coding so might come back asking you or someone else to point me to the right direction.

Thank you again!

Re: Conversion TIFF to PNG, TIFF to JPG

Posted: 2016-06-20T04:42:55-07:00
by snibgo
In a nutshell: it reads each image in the input file, storing pixel data in a pixel cache, and metadata in a structure. It does that for all the formats that it can read internally, such as png, jpg, tiff etc. The source code for reading is in the "coders" directory.

It does the inverse for writing. The writing functions are also there, so for example coders\png.c contains the code to both read and write PNG files.

For formats that IM can't directly read or write, it delegates the work to external programs, going via a format it can understand.

Re: Conversion TIFF to PNG, TIFF to JPG

Posted: 2016-06-20T17:31:41-07:00
by fmw42
What is the point of the question? Is there some bug you are encountering or some feature that is missing? Are you trying to make some enhancement? What is the motivation for the question.

Re: Conversion TIFF to PNG, TIFF to JPG

Posted: 2016-06-21T01:23:54-07:00
by Minary
Thank you snibgo! I really appreciate it!

I will have a look tonight (haven't had time yet).

@fmw42 The point of the question is that I am using this for a university project and want to understand what's happening under the hood.