Conversion TIFF to PNG, TIFF to JPG

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
Minary
Posts: 3
Joined: 2016-06-20T04:11:21-07:00
Authentication code: 1151

Conversion TIFF to PNG, TIFF to JPG

Post by Minary » 2016-06-20T04:13:56-07:00

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

snibgo
Posts: 12398
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Conversion TIFF to PNG, TIFF to JPG

Post by snibgo » 2016-06-20T04:26:59-07:00

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.
snibgo's IM pages: im.snibgo.com

Minary
Posts: 3
Joined: 2016-06-20T04:11:21-07:00
Authentication code: 1151

Re: Conversion TIFF to PNG, TIFF to JPG

Post by Minary » 2016-06-20T04:34:41-07:00

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!

snibgo
Posts: 12398
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Conversion TIFF to PNG, TIFF to JPG

Post by snibgo » 2016-06-20T04:42:55-07:00

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.
snibgo's IM pages: im.snibgo.com

User avatar
fmw42
Posts: 25737
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Conversion TIFF to PNG, TIFF to JPG

Post by fmw42 » 2016-06-20T17:31:41-07:00

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.

Minary
Posts: 3
Joined: 2016-06-20T04:11:21-07:00
Authentication code: 1151

Re: Conversion TIFF to PNG, TIFF to JPG

Post by Minary » 2016-06-21T01:23:54-07:00

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.

Post Reply