BlobToImage doesn't work
Posted: 2009-09-14T04:30:35-07:00
I cant get BlobToImage() to work
My Code:
Doesn't work - the image looks the same as before.
If i use a second Image-Object to write the blob to - nothing happens at all.
The ImagetoBlob function works, because i get the right gray-values.
Thank you for any help
My Code:
Code: Select all
my $image=Image::Magick->new();
$image->Read('pics/example.bmp');
$image->Set(magick=>'Gray'); # My images are all 8 bit Gray BMP's
my $blob=$image->ImageToBlob();
my @grayvals = unpack "C*",$blob;
foreach my $element(@grayvals) # Setting all pixel to 0 for testing
{
$element = 0;
}
$blob=pack "C*",@grayvals;
$image->BlobToImage($blob);
$image->Write('example_out.bmp');
If i use a second Image-Object to write the blob to - nothing happens at all.
The ImagetoBlob function works, because i get the right gray-values.
Thank you for any help