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.
rajendram
Posts: 6 Joined: 2013-09-04T04:36:36-07:00
Authentication code: 6789
Post
by rajendram » 2013-09-04T04:46:19-07:00
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
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2013-09-04T04:55:07-07:00
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).
rajendram
Posts: 6 Joined: 2013-09-04T04:36:36-07:00
Authentication code: 6789
Post
by rajendram » 2013-09-04T05:20:28-07:00
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
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2013-09-04T05:22:23-07:00
You can put files on Dropbox.com or other free hosting site, and post the URL here.
rajendram
Posts: 6 Joined: 2013-09-04T04:36:36-07:00
Authentication code: 6789
Post
by rajendram » 2013-09-04T05:29:16-07:00
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
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2013-09-04T05:45:37-07:00
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".
rajendram
Posts: 6 Joined: 2013-09-04T04:36:36-07:00
Authentication code: 6789
Post
by rajendram » 2013-09-04T05:55:49-07:00
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
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2013-09-04T06:12:36-07:00
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).
rajendram
Posts: 6 Joined: 2013-09-04T04:36:36-07:00
Authentication code: 6789
Post
by rajendram » 2013-09-04T06:15:29-07:00
Thanks snibgo,
Can you pls share a php code which keeps the TIFF image quality in generated multipage tiff image ?
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2013-09-04T06:28:21-07:00
Sorry, I don't do PHP. There may be something on the PHP forum:
viewforum.php?f=10
rajendram
Posts: 6 Joined: 2013-09-04T04:36:36-07:00
Authentication code: 6789
Post
by rajendram » 2013-09-05T00:31:48-07:00
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
snibgo
Posts: 12159 Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2013-09-05T07:24:31-07:00
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.
fmw42
Posts: 25562 Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA
Post
by fmw42 » 2013-09-05T18:24:19-07:00