problem with enlarge an image using Scale/Sample

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
ycul

problem with enlarge an image using Scale/Sample

Post 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.
Last edited by ycul on 2006-12-04T15:08:15-07:00, edited 1 time in total.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Use
  • $image->Sample();
ycul

Post by ycul »

Same result. :(
magick wrote: Use
  • $image->Sample();
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Ok, add
  • $image->Quantize( colors=>2, colorspace=>'gray' );
right after you scale the image.
ycul

Post 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.
Post Reply