Tile PNG, Adjoin into PDF - Offset Problem

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
patrickr
Posts: 3
Joined: 2011-10-09T11:03:27-07:00
Authentication code: 8675308

Tile PNG, Adjoin into PDF - Offset Problem

Post by patrickr »

Hello

Can anyone explain how to fix the following problem?

I split an image into tiles using:

convert x.png -crop 750x1000 'tiles-%d'

Then I make a pdf where each tile gets a whole page:

convert -adjoin "'tiles-0' 'tiles-1' ..." -units PixelsPerInch -density 100 'pdf:p'

If I use jpgs instead of pngs, this all works fine. But if I use pngs, the image on each page is increasingly offset to the right and down.

I gather ImageMagick can't store offset information in jpgs when tiling, but that it manages to do this for pngs. I assume the solution is to get ImageMagick to ignore offset info in the pngs, or not to create it all. I've tried adding +page and +repage in various places but haven't found the right permutation.

Does anyone know how to change those 2 commands above to fix the problem?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Tile PNG, Adjoin into PDF - Offset Problem

Post by fmw42 »

try

convert x.png -crop 750x1000 +repage 'tiles-%d'
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Tile PNG, Adjoin into PDF - Offset Problem

Post by anthony »

For details see
The Basic Crop Operator...
http://www.imagemagick.org/Usage/crop/#crop
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply