Page 1 of 1

problem with enlarge an image using Scale/Sample

Posted: 2006-12-04T14:04:36-07:00
by ycul
I was trying to Converts and saves TIFF files with Group 4 compression , max width of 5800 px, max height of 5800 px and a distort aspect of 1.

Here is a list of commands I used:
my $res = $image->Set(compression=>'Group4');
my $res = $image->Scale(width=>5800, height=>5800);
my $res = $image->Write($outfile);

I tested it with an image of 4.3M and a Width of 2588 and length of 1731.
The output is ridiculous: a 22M image with a width of 5800 and length of 3879.

Anybody can tell me where i am wrong? Thanks for the help.

Posted: 2006-12-04T14:55:46-07:00
by magick
Use
  • $image->Sample();

Posted: 2006-12-04T14:58:27-07:00
by ycul
Same result. :(
magick wrote: Use
  • $image->Sample();

Posted: 2006-12-04T16:17:20-07:00
by magick
Ok, add
  • $image->Quantize( colors=>2, colorspace=>'gray' );
right after you scale the image.

Posted: 2006-12-05T08:39:02-07:00
by ycul
Added Quantize() after scale, still doesn't work.

Is there a problem with an image being smaller than what sample/scale
sets it to?

Problem exists only when the image size has to be increased.