Page 1 of 1
Multipage TIFF file not having original TIFF image quality.
Posted: 2013-09-04T04:46:19-07:00
by rajendram
Hi,
I have following code which generates multipage TIFF file name as multi.TIFF from the img folder. However it is failed to keep original individual TIFF image quality.
Please have a look into this issue and provide valid solution/feedback on this.
Code: Select all
$multiTIFF = new Imagick();
$mytifspath = "z:/imagemagik/img/";
foreach(new DirectoryIterator('z:/imagemagik/img/') as $file)
{
if( $file->isFile() === TRUE && $file->getBasename() !== 'Thumbs.db')
{
$auxIMG = new Imagick();
$auxIMG->ReadImage($mytifspath.htmlentities($file->getBasename()));
$multiTIFF->addImage($auxIMG);
}
}
$multiTIFF->writeImages('z:/imagemagik/multi.TIFF', true);
Feedback appreciated..!
Thanks,
Rajendra
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T04:55:07-07:00
by snibgo
What IM version? What platform?
What quality loss do you see? Can you put up sample images?
What compression are you using, if any? If they are JPEG-compressed, then IM will read each image and re-write it, which will lose quality. Zip or Lzw are better (lossless compression).
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T05:20:28-07:00
by rajendram
Hi,
Thank you for your quick reply.
However I am here unable to attach file as I tried to PM also but it is not allowing to upload tiff/zip file.
I am using latest windows version of Imagemagick version ImageMagick 6.8.6-8 2013-08-04 Q16 under XAMPP 3.2.1 under Windows 7.
Thanks,
Rajendra
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T05:22:23-07:00
by snibgo
You can put files on Dropbox.com or other free hosting site, and post the URL here.
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T05:29:16-07:00
by rajendram
Hi,
Please check this zip file
http://tinyurl.com/lmwq838 .
It consist of original grey colored file name as GreyColoredFile.TIFF.
And generated multipage tiff file as multi.TIFF which is created after merging 3 TIFF files including GreyColoredFile.TIFF file.
Thanks
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T05:45:37-07:00
by snibgo
Your input file is greyscale, JPEG compressed. Your output is bilevel, Group4 compressed, probably because the first file was like that.
You should ensure that all input files to your convert are greyscale (not bilevel), and use "-compress Zip".
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T05:55:49-07:00
by rajendram
Hi,
Please check this file
http://tinyurl.com/o6e7hh3.
It is generated through dotnet tool.
Can such type of multipage TIFF image can be achieved?
Also do you expect me to change the compression of created individual tiff files to keep original image quality in generated multi.TIFF file?
Thanks
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T06:12:36-07:00
by snibgo
As far as I know, when ImageMagick creates a multi-page tiff, all images will be the same compression (none, Group4, LZW, etc) and same type (greyscale, bilevel, etc).
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T06:15:29-07:00
by rajendram
Thanks snibgo,
Can you pls share a php code which keeps the TIFF image quality in generated multipage tiff image ?
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-04T06:28:21-07:00
by snibgo
Sorry, I don't do PHP. There may be something on the PHP forum:
viewforum.php?f=10
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-05T00:31:48-07:00
by rajendram
Hi,
Can you pls tell :
1. How to change compression of current tiff file to COMPRESSION_LZW.
2. How can I change Photometric to Palette from MinIsBlack.
Thanks
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-05T07:24:31-07:00
by snibgo
1. In a command, include "-compression LZW". I don't know how to do this in PHP.
2. Photometric can take values min-is-black or min-is-white only.
Re: Multipage TIFF file not having original TIFF image quali
Posted: 2013-09-05T18:24:19-07:00
by fmw42