tiff 'convert' ... ImageMagick ... 1.5 seconds ... to a 1024x768 PNG. The originals are ... 40KB ... The PNG is truecolour and closer to 300KB ...

I'm not sure to have understood what you did and why it didn't work. These times and sizes are not what I got here.

For testing purpose, I screen-copied this PerlMonk web page with your question, pasted it into Photoshop, resized it to 2200x1600, converted it to bitmap and blurred it until it's monochrome tiff (lzw) had about 48KB. This file was named 'originalmono.tiff'

Now I started cygwin and issued a

$> for i in `seq -w 1 100`; do cp originalmono.tiff originalmono${i}.tiff; done

which gave me 100 of these 48K images (originalmono001.tiff etc). Next, a snippet using Imager (0.61, which is what I use most of the time) was written:

use strict; use warnings; use Imager; my $fn='originalmono'; my $img = Imager->new(); my $tdiff = time(); opendir my $dirh, '.' or die "Can't read: $!"; while( my $name = readdir $dirh ) { if( $name =~ /^$fn\d+.+tiff$/ ) { $img->read(file=>$name) or die $img->errstr(); # *** qtype=>'preview' / qtype=>'normal' my $omg = $img->scale(xpixels=>1024, ypixels=>768, type=>'min', + qtype=>'preview'); # *** file=>"$name.png" / file=>"$name.gif" $omg->write(file=>"$name.png") or die "Can't write: ", $img->er +rstr; } } $tdiff = time() - $tdiff; closedir $dirh; print "$tdiff seconds\n"

In 'preview' scaling mode, the 100 png's are out after 21 sec (.png size: 21K), in 'normal' scaling mode (which is: "quality mode"), the 100 files are done after 98sec (.png size 48K). If you change the output format to 'gif', the 100 gifs ('normal mode') take about 100 sec, each .gif-File is 33K. BTW: This is an Athlon64/3200 under Win-XP. I re-checked the run times under Linux/vmware, they differ only by a second or two.

Regards

mwa


In reply to Re: Resizing large TIF files by mwah
in thread Resizing large TIF files by grantm

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.