I cann't scale gif with correctly with perlmagick.

Discussion in 'Perl Misc' started by kenny, Apr 7, 2004.

  1. kenny

    kenny Guest

    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?
     
    kenny, Apr 7, 2004
    #1
    1. Advertising

  2. kenny

    Tore Aursand Guest

    On Wed, 07 Apr 2004 00:41:33 -0700, kenny wrote:
    > $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.


    --
    Tore Aursand <>
    "The pure and simple truth is rarely pure and never simple." -- Oscar
    Wilde
     
    Tore Aursand, Apr 7, 2004
    #2
    1. Advertising

  3. kenny

    kenny Guest

    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?
     
    kenny, Apr 9, 2004
    #3
  4. kenny

    Tore Aursand Guest

    On Thu, 08 Apr 2004 21:48:25 -0700, kenny wrote:
    > 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?


    --
    Tore Aursand <>
    "The pure and simple truth is rarely pure and never simple." -- Oscar
    Wilde
     
    Tore Aursand, Apr 9, 2004
    #4
  5. kenny

    kenny Guest

    Tore Aursand <> wrote in message news:<>...
    > On Thu, 08 Apr 2004 21:48:25 -0700, kenny wrote:
    > > 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?



    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?
     
    kenny, Apr 12, 2004
    #5
  6. kenny

    John Bokma Guest

    kenny wrote:

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

    --
    John personal page: http://johnbokma.com/

    Experienced Perl / Java developer available - http://castleamber.com/
     
    John Bokma, Apr 12, 2004
    #6
  7. In article <>,
    (kenny) wrote:

    > 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

    --
    Pukku
     
    Richard Morse, Apr 12, 2004
    #7
  8. kenny

    kenny Guest

    Richard Morse <> wrote in message news:<>...
    > In article <>,
    > (kenny) wrote:
    >
    > > 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


    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?
     
    kenny, Apr 19, 2004
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?cmFhZ3o=?=
    Replies:
    1
    Views:
    13,099
    bennybollo
    Aug 6, 2008
  2. =?Utf-8?B?S2VtaW4=?=
    Replies:
    0
    Views:
    378
    =?Utf-8?B?S2VtaW4=?=
    Jun 11, 2006
  3. Kemin
    Replies:
    0
    Views:
    448
    Kemin
    Jun 12, 2006
  4. steve

    Cann't connect zope server

    steve, Oct 31, 2006, in forum: Python
    Replies:
    1
    Views:
    655
    Bruno Desthuilliers
    Oct 31, 2006
  5. Roka
    Replies:
    6
    Views:
    326
    Fei Liu
    Apr 2, 2006
Loading...

Share This Page