0

I am trying to convert a large (>1gb) tiff image into a pyramidal tiff with tile-geometry at 256x256. At the moment I am currently running this command in php:

exec("convert nopyramid.tif -define tiff:tile-geometry=256x256 -compress jpeg 'ptif:withpyramid.tif'");

I am trying to figure out how to use imagick to create a tiled tiff. I can't find any information that refers to this possibility except another stack exchange question listed here:

php imagemagick create a Tiled Pyramid TIFF

The reason I would like to use imagick's API is because, from what I have found, it will callback "progress" during the conversion if it's set. The above "exec" conversion will not report anything during the process even if you designated "-monitor" after "convert."

$image = nopyramid.tif"; 
$im = new Imagick();
$im->pingImage($image);
$im->readImage($image);
$im->setImageFormat('ptif');
$im->transformImage("256x256","256x256");
$im->writeImage('withpyramid.tif');

This doesn't seem to work however. Any thoughts/tips are greatly appreciated!

Community
  • 1
  • 1
Spatial Pariah
  • 351
  • 4
  • 17

1 Answers1

0

"Any thoughts/tips are greatly appreciated!"

Doing this in PHP is a terrible idea. It just really isn't that well designed for coping with huge amounts of memory being allocated.

You would be much better off either writing a small program in C that uses the Image Magick library and does the processing for you, or figuring out how to get the monitor to work properly.

Danack
  • 24,939
  • 16
  • 90
  • 122