I cann't scale gif with correctly with perlmagick.

K

kenny

i face a problem when i scaling the dynamic gif image.

after scale the image, the image have appear incorrectly.

my code is like below:
###########################
!/usr/local/bin/perl
use strict;
use Image::Magick;

my $image = new Image::Magick;
$image->Read('sample.gif');

my $Width = $image->Get('Width');
my $Height = $image->Get('Height');

$Width = $Width * 0.7;
$Height = $Height * 0.7;

$image->Scale(Height=>$Width, $Height);

$image->Write('gif:scale.gif');

########################################

so someone have know solution not or any extra methd use to scale the gif image?
 
T

Tore Aursand

$image->Scale(Height=>$Width, $Height);

Never used Image::Magick, actually, but are you sure this line is correct?
It doesn't _look_ correct to me, as it would have made more sense to write
something like this:

$image->Scale(Width => $Width,
Height => $Height);

Maybe I'm wrong.
 
K

kenny

Thanks correct my syntax.

$image->Scale(Width => $Width, Height => $Height);

but anyway, after i correct to this also face the same problem.

after scaling animate gif(multiple image).
the first image look is okay.
but the 2nd image and following image look like got some white dot or
sometime got black dot at the image.

i think it cann't scale in correct way especially scale the image to
small size.

anyone got any ideal or method to scale the gif?
 
T

Tore Aursand

Thanks correct my syntax.

You should _always_ copy and paste the actual code. Don't try to rewrite
the particular code.
but anyway, after i correct to this also face the same problem. after
scaling animate gif(multiple image).

As previously said; I don't know much about ImageMagick (note to myself:
make sure that I know much about ImageMagic a month from now), but are you
sure it supports animated gifs?
 
K

kenny

Tore Aursand said:
You should _always_ copy and paste the actual code. Don't try to rewrite
the particular code.


As previously said; I don't know much about ImageMagick (note to myself:
make sure that I know much about ImageMagic a month from now), but are you
sure it supports animated gifs?


I am Sure Image-Magick is support animated gifs. because when u read
animate gif with perl-magick then can write a new gif with correctly
without loss the quality image.

but the problem is when the scale method apply to animate gif. the gif
after scale look like incorrectly.... sometime u will see the white
dot.
me suspect is image-magick don scale image with smoothly and leave
some blank/white dot after scaling at the image. because scale ratio
don return accuracy.

eg: first image of animate gif size is 280X 280 scale to 80%. so
image size now is 224X224.

second image of animate gif size is 150X 150 scale to 80%. so image
size now is 187.5X187.5. but..... in the pixel, we don't have .5
pixel. so problem is come. so maybe second image scale to 187X187 or
188X188. this situation maybe will leave white dot/blank dot....

so any solution to solve this problem or not?
 
J

John Bokma

kenny said:
second image of animate gif size is 150X 150 scale to 80%. so image
size now is 187.5X187.5. but..... in the pixel, we don't have .5
pixel. so problem is come. so maybe second image scale to 187X187 or
188X188. this situation maybe will leave white dot/blank dot....

so any solution to solve this problem or not?

Doesn't GIF animation not rely very much on transparency?. Maybe scaling
each individual GIF frame and reassembling it into an animation, and
optimizing it, gives the right result.
 
R

Richard Morse

eg: first image of animate gif size is 280X 280 scale to 80%. so
image size now is 224X224.

second image of animate gif size is 150X 150 scale to 80%. so image
size now is 187.5X187.5. but..... in the pixel, we don't have .5
pixel. so problem is come. so maybe second image scale to 187X187 or
188X188. this situation maybe will leave white dot/blank dot....

I'm pretty sure that, although you can very probably make animated gifs
with different sized components, things will be much easier if all the
images in the animation are the same size.

Perhaps you should try fixing the animated gif to make every frame the
same size?

Ricky
 
K

kenny

Richard Morse said:
I'm pretty sure that, although you can very probably make animated gifs
with different sized components, things will be much easier if all the
images in the animation are the same size.

Perhaps you should try fixing the animated gif to make every frame the
same size?

Ricky

I know fixing the animated gif to make every frame the same size. but
how?

i already try several mehthod scaling the image. when i scale the
second image untill same same as first image. the element in image
become bigger if scale to big size or become smaller if i scale to
small size.

then i try to use annotate method. I try annotate second image(small
size one) to sample blank image which have same size to first image.
then bigger or smaller size is settle, but....another problem is come,
the position image is running of original one.....because sometimes
second image is place several place. sometime is is
northern,westhern,center,...etc. how i know where the image should i
place in position(x,y).

so any solution to place the image to right position?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,091
Members
48,773
Latest member
Kaybee

Latest Threads

Top