Re: Macro for ImageResize
Posted by Carnë Draug on Nov 19, 2010; 2:52pm
URL: http://imagej.273.s1.nabble.com/Macro-for-ImageResize-tp3686379p3686386.html
I forgot to mention one thing about the scripts. They skip every file
whose extension does not end in jpg (this is to allow files other than
images on the directory, such as log files). This can be easily
changed to your needs. To allow both jpg, tiff, tif and png
extensions, replace the line
if ($file =~ m/jpg$/i){
by the line
if ($file =~ m/(jpg|tif|tiff|png)$/i){
That is, basically just enter the extensions in a parethensis separated by a |
On the subject of losing the image quality every time you save a JPEG
image, you can set its quality as in the following example (the
following example only applies for JPEG/MIFF/PNG images).
$image -> Write(filename => $path,
quality => 100,
);
Carnë