image offset

mick crane <[email protected]> Thu, 11 Jul 2019 08:31:02 +0100
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
hello,
using Image::Magick
I have a series of images which have no offset.
$ identify 0019.png
0019.png PNG 2400x1800 2400x1800+0+0 8-bit sRGB 1.13165MiB 0.000u 
0:00.000

I have an array of width height x and y which I loop through and crop 
and resize these big images

my $t=10000;
for (my $a=0;$a<=$#camera;$a++){
my $image=Graphics::Magick->new;
$image->Set(size=>"$art_width". "x"."$art_height");
$image->Read($camera[$a][4]);
$image->Crop(width=>$camera[$a][0],height=> $camera[$a][1], 
x=>$camera[$a][2],y=> $camera[$a][3]);
$image->Resize(width=>750,height=>500);
$image->Write($out_directory."/frames/".$t.".png");
$image = undef;
$t+=1;
}

the resulting images have an offset.
$ identify 10007.png
10007.png PNG 750x500 750x500+209+77 8-bit sRGB 218330B 0.000u 0:00.000

which looks as you'd want in geeqie but if I try to make a gif from them
my $image=Graphics::Magick->new;
my $gif=$image->Read ("$dir/frames/*.png");
my $gif2=$image->Write("$dir/$t\.gif");

the images are all over the place.

I think what I want is -repage to get rid of the offset.
I'm uncertain what the offset is supposed to do because same image with 
or without seems to make no difference in the viewer.
I'm not that good at Perl and need advice how to translate the gm 
instructions into Perl syntax.
where would I put "-repage" ?
I also don't know how the actual .png files are constructed and wouldn't 
mind a link to some resource that might help me understand how all these 
image files work.

cheers

mick



-- 
Key ID    4BFEBB31