in reply to Re^2: Howto convert Image::Grab jpg object to Image::Magick object???
in thread Howto convert Image::Grab jpg object to Image::Magick object???
Hi
I found this code sample that converts from GD to Image::Magick objects. It is like I want to do and it should work between any objects.
Haukex, I will give your code a go.
#!/user/bin/perl use strict; use Image::Magick; use GD; # First read an image with Image::Magick my $im = new Image::Magick; my $status = $im->Read('monkey.png'); if ($status) { die "$Status!"; } # Convert to a blob and hand off to GD my @blobs = $im->ImageToBlob(); my $gd = GD::Image->newFromPngData($blobs[0]); my $red = $gd->colorAllocate(255,0,0); # Outline in Red $dg->rectangle(0,0, (map {$_-1} $gd-?getBounds), $red); # There and back again my $im2 = new Image::Magick; $im2->BlobToImage($gd->png()); $im2->Write('png:monkeyout.png');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Howto convert Image::Grab jpg object to Image::Magick object???
by haukex (Archbishop) on Mar 27, 2017 at 09:56 UTC | |
by dazz (Beadle) on Mar 27, 2017 at 19:47 UTC | |
by dazz (Beadle) on Apr 14, 2017 at 08:07 UTC | |
by Anonymous Monk on Apr 14, 2017 at 11:02 UTC | |
by dazz (Beadle) on Apr 16, 2017 at 00:08 UTC |