Convert Image sinto PDF and export PDF to uncompressed TIF

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
LittleKI
Posts: 32
Joined: 2015-01-11T11:55:29-07:00
Authentication code: 6789

Convert Image sinto PDF and export PDF to uncompressed TIF

Post by LittleKI »

Hi,

i have 2 questions.

1.) i want to create a pdf file with several image files. i changed the exiftrans of the images by using exiv2. when i create a pdf with

Code: Select all

convert input output.pdf
convert ignores the changed exiftrans tag. how can i fix that? i couldn't find any option in the convert help.

2.) when i extract all the pages of a pdf file into several uncompressed images (every page into 1 image) with

Code: Select all

convert -format tiff input.pdf output
the resulting output isn't tiff, its png. so how can i export tiff and how can i set up that the tiff files are saved uncompressed?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert Image sinto PDF and export PDF to uncompressed TIF

Post by fmw42 »

For 2)

try

Code: Select all

convert input.pdf +adjoin output.tif
For 1), as a guess, I think you changed the meta data for the raster file that gets enclosed by the PDF vector shell. So you did not change any meta data for the PDF. I am not sure it can store such meta data. Perhaps some one else knows more about this.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Image sinto PDF and export PDF to uncompressed TIF

Post by snibgo »

I don't know what the "exiftrans" tag is, or does, or should do. Is there any documentation somewhere?

"-format" is an option for mogrify, not convert. See http://www.imagemagick.org/script/comma ... php#format . "convert" will ignore the option.

We normally specify the output format with an extension, eg ".tiff" or ".tif". If you have no extension, prefix it with "tiff:", eg "tiff:output".
snibgo's IM pages: im.snibgo.com
LittleKI
Posts: 32
Joined: 2015-01-11T11:55:29-07:00
Authentication code: 6789

Re: Convert Image sinto PDF and export PDF to uncompressed TIF

Post by LittleKI »

1.)
My Mistake, Exiftrans is just a program to edit these tags for jpg. the program exiv2 can edit the tags also for tiff. th tags are called "exif", maybe this can help: http://www.sno.phy.queensu.ca/~phil/exi ... /EXIF.html i edit the tags with this command line
exiv2 -k -M"set Exif.Image.Orientation 3" %F
this rotates the image to 180 degrees. exiv2 (and exiftrans for jpg, of course) don't change the image, they only edit a tag and all programs that can read out the tag display it in the right way - rotated to 180 degrees. i think convert ignores the tag.

2.)
This works, thanks. but the resulting tiff files doesn't have the same size as the tiff files i've created from the pdf with the windows tool pdf xchange view (here i can set up output as uncompressed tiff). the files created by pdf xchange view are much bigger
Last edited by LittleKI on 2016-10-31T09:11:04-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert Image sinto PDF and export PDF to uncompressed TIF

Post by fmw42 »

Imagemagick does not write EXIF tags but can read them. See http://www.imagemagick.org/script/escape.php

IM cannot create a new (sub)directory for you. But if you create one, the convert command can send the output to that directory by putting the path in the output file specified.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Image sinto PDF and export PDF to uncompressed TIF

Post by snibgo »

... and all programs that can read out the tag display it in the right way - rotated to 180 degrees. i think convert ignores the tag.
See http://www.imagemagick.org/script/comma ... uto-orient
snibgo's IM pages: im.snibgo.com
LittleKI
Posts: 32
Joined: 2015-01-11T11:55:29-07:00
Authentication code: 6789

Re: Convert Image sinto PDF and export PDF to uncompressed TIF

Post by LittleKI »

OK, this works.

But whats with that:
This works, thanks. but the resulting tiff files doesn't have the same size as the tiff files i've created from the pdf with the windows tool pdf xchange view (here i can set up output as uncompressed tiff). the files created by pdf xchange view are much bigger
When i specify the format with '-format tiff', how can i specify that convert creates uncompressed tiff?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Convert Image sinto PDF and export PDF to uncompressed TIF

Post by snibgo »

For uncompressed output, use:

Code: Select all

-compress None
snibgo's IM pages: im.snibgo.com
Post Reply