On 08/17/2012 05:04 AM, Rainer Weikusat wrote:
> Cal Dershowitz <c...@example.invalid> writes:
>> On 08/15/2012 01:17 AM, Mart van de Wege wrote:
>>> install ImageMagick
>>
>> [x-posted to alt.os.linux.ubuntu]
>>
>> I tried hard today but failed. I understand that people don't want to
>> see logs. I mean other people, usually the barkey ones. I don't find
>> it unpleasant to read a log.
>>
>> Q1) Can anybody who has Imagemagick.h in a place that does something
>> useful tell me where it is on his/her installation?
>
> First, have you considered to install the Ubuntu package for the
> module in question? This should take care of installing any
> depedencies automatically and you won't even need the build
> dependencies. The Debian package is called 'perlmagic', cf
Thanks for your reply, rainer; you are definitely rainer einer. I got
stung pretty hard on disambiguating the terms with Image, image magick
magic, and perl. perllib wasn't even hooked up correctly, which
surprised me, because I watched perl 5.14.2 get downloaded before my eyes.
One of the many things I've learned so far is what's supposed to go in
usr. I untarred files but can not yet say that that has ever done
anything good for me.
>
> ,----
> | [rw@sapphire]~ $sudo apt-cache search magick | grep perl
> | libgraphics-magick-perl - format-independent image processing - perl interface
> | perlmagick - Perl interface to the ImageMagick graphics routines
> | libchart-gnuplot-perl - module for generating two- and three-dimensional plots
> | libimage-size-perl - module for determining image sizes in several common formats
> `----
>
> It is generally a better idea to use software packaged by the
> distribution insofar available. You can spare yourself a lot of
> trouble if you don't use any 'upstream sources' directly except if you
> need specific features (or fixes) not yet available elsewhere or if
> you want or need to use them as base for independent developments (eg,
> the DBD::Pg I'm presenty using as been significantly changed by me
> because I needed working support for asychronous database interactions
> and more differentiated error handling than die("It failed!"), two
> things of no particular concern to the people who maintain the public
> version).
>
> Assuming you still want to install the CPAN-version, the easiest way
> to deal with its build depedencies is to use the packaged versions for
> these. Since you want to compile something which uses this library,
> the library package alone won't do, you'll need the so-called
> development package as well. Again using apt-cache to search for
> likely suspects yields
My real problem here was that I couldn't use my OS for system updates as
I had before. The look was completely different. I typed in
ImageMagick and got nothing. I'd be interesting from Mike Easter and
others how to put the best face on it, as he has experience explaining
to me how linux bugs are actually features.
>
> ,----
> | [rw@sapphire]~ $sudo apt-cache search magick | grep lib | grep -- -dev
> | graphicsmagick-libmagick-dev-compat - image processing librariesproviding ImageMagick interface
> | libgraphicsmagick++1-dev - format-independent image processing - C++ development files
> | libgraphicsmagick1-dev - format-independent image processing - C development files
> | libmagick++-dev - object-oriented C++ interface to ImageMagick - development files
> | libmagickcore-dev - low-level image manipulation library - development files
> | libmagickwand-dev - image manipulation library - development files
> | libvips-dev - image processing system good for very large images (dev)
> `----
>
> Since you were missing a library named MagickCore and a header of the
> same name, the candidate suggesting itself would be libmagickcore-dev.
> You can install that with
>
> apt-get install libmagickcore-dev
This is the thing I need to rely on.
>
> This will install a bunch of other stuff the package maintainer
> considered to be necessary for using this package (which might or
> might not be true) or thought you should really be using for whatever
> reason (aka 'avahi-daemon' ...) but unless you're seriously short of
> diskspace or want/ need to control every detail, that's not worth
> bothering with.
>
> I usually disable automatic installation of 'recommended other
> packages' because I grew tired of deinstalling the avahi- and
> dbus-daemons over and over again :->. This can be done by creating a
> file /etc/apt/apt.conf with the following content (or by adding it to
> an existing apt.conf file)
>
> APT {
> Install-Recommends "false";
> };
>
You lost me there at the end, but I'll assume that they were
qualifications to a more-learned crowd.
I think I've got more of it than I don't:
#!/usr/bin/perlfred@fred-desktop:~/Desktop/scripts$ perl
im1.pl
Read...
Exception 435: unable to open image `model.gif': @
error/blob.c/OpenBlob/2587 at
im1.pl line 18.
Exception 435: unable to open image `smile.gif': @
error/blob.c/OpenBlob/2587 at
im1.pl line 24.
Transform image...
Adaptive Blur...
Can't locate object method "Label" via package "Exception 410: no images
defined `Image::Magick' @ error/Magick.xs/XS_Image__Magick_Clone/2928"
(perhaps you forgot to load "Exception 410: no images defined
`Image::Magick' @ error/Magick.xs/XS_Image__Magick_Clone/2928"?) at
im1.pl line 35.
fred@fred-desktop:~/Desktop/scripts$
#
# Overall demo of the major PerlMagick methods.
#
use Image::Magick;
#
# Read model & smile image.
#
print "Read...\n";
$null=Image::Magick->new;
$null->Set(size=>'70x70');
Contention: because the first error is after logo.gif, then the use
statement worked.
I'm trying not to make superlong posts, so I'll sign out and leave the
source for
im1.pl after the sig.
I'm bin durch diese Erfahrung begeistert worden.
--
Cal
#!/usr/bin/perl
#
# Overall demo of the major PerlMagick methods.
#
use Image::Magick;
#
# Read model & smile image.
#
print "Read...\n";
$null=Image::Magick->new;
$null->Set(size=>'70x70');
$x=$null->ReadImage('NULL:black');
warn "$x" if "$x";
$model=Image::Magick->new();
$x=$model->ReadImage('model.gif');
warn "$x" if "$x";
$model->Label('Magick');
$model->Set(background=>'white');
$smile=Image::Magick->new;
$x=$smile->ReadImage('smile.gif');
warn "$x" if "$x";
$smile->Label('Smile');
$smile->Set(background=>'white');
#
# Create image stack.
#
print "Transform image...\n";
$images=Image::Magick->new();
print "Adaptive Blur...\n";
$example=$model->Clone();
$example->Label('Adaptive Blur');
$example->AdaptiveBlur('0x1');
push(@$images,$example);
print "Adaptive Resize...\n";
$example=$model->Clone();
$example->Label('Adaptive Resize');
$example->AdaptiveResize('60%');
push(@$images,$example);
print "Adaptive Sharpen...\n";
$example=$model->Clone();
$example->Label('Adaptive Sharpen');
$example->AdaptiveSharpen('0x1');
push(@$images,$example);
print "Adaptive Threshold...\n";
$example=$model->Clone();
$example->Label('Adaptive Threshold');
$example->AdaptiveThreshold('5x5+5%');
push(@$images,$example);
print "Add Noise...\n";
$example=$model->Clone();
$example->Label('Add Noise');
$example->AddNoise("Laplacian");
push(@$images,$example);
print "Annotate...\n";
$example=$model->Clone();
$example->Label('Annotate');
$example->Annotate(text=>'Magick',geometry=>'+0+20',font=>'Generic.ttf',
fill=>'gold',gravity=>'North',pointsize=>14);
push(@$images,$example);
print "Auto-gamma...\n";
$example=$model->Clone();
$example->Label('Auto Gamma');
$example->AutoGamma();
push(@$images,$example);
print "Auto-level...\n";
$example=$model->Clone();
$example->Label('Auto Level');
$example->AutoLevel();
push(@$images,$example);
print "Blur...\n";
$example=$model->Clone();
$example->Label('Blur');
$example->Blur('0.0x1.0');
push(@$images,$example);
print "Border...\n";
$example=$model->Clone();
$example->Label('Border');
$example->Border(geometry=>'6x6',color=>'gold');
push(@$images,$example);
print "Channel...\n";
$example=$model->Clone();
$example->Label('Channel');
$example->Channel(channel=>'red');
push(@$images,$example);
print "Charcoal...\n";
$example=$model->Clone();
$example->Label('Charcoal');
$example->Charcoal('0x1');
push(@$images,$example);
print "ColorMatrix...\n";
$example=$model->Clone();
$example->Label('ColorMatrix');
$example->ColorMatrix([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0.5, 0, 1, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 1]);
push(@$images,$example);
print "Composite...\n";
$example=$model->Clone();
$example->Label('Composite');
$example->Composite(image=>$smile,compose=>'over',geometry=>'+35+65');
push(@$images,$example);
print "Contrast...\n";
$example=$model->Clone();
$example->Label('Contrast');
$example->Contrast();
push(@$images,$example);
print "Contrast Stretch...\n";
$example=$model->Clone();
$example->Label('Contrast Stretch');
$example->ContrastStretch('5%');
push(@$images,$example);
print "Convolve...\n";
$example=$model->Clone();
$example->Label('Convolve');
$example->Convolve([1, 1, 1, 1, 4, 1, 1, 1, 1]);
push(@$images,$example);
print "Crop...\n";
$example=$model->Clone();
$example->Label('Crop');
$example->Crop(geometry=>'80x80+25+50');
$example->Set(page=>'0x0+0+0');
push(@$images,$example);
print "Despeckle...\n";
$example=$model->Clone();
$example->Label('Despeckle');
$example->Despeckle();
push(@$images,$example);
print "Distort...\n";
$example=$model->Clone();
$example->Label('Distort');
$example->Distort(method=>'arc',points=>[60],'virtual-pixel'=>'white');
push(@$images,$example);
print "Draw...\n";
$example=$model->Clone();
$example->Label('Draw');
$example->Draw(fill=>'none',stroke=>'gold',primitive=>'circle',
points=>'60,90 60,120',strokewidth=>2);
push(@$images,$example);
print "Detect Edges...\n";
$example=$model->Clone();
$example->Label('Detect Edges');
$example->Edge();
push(@$images,$example);
print "Emboss...\n";
$example=$model->Clone();
$example->Label('Emboss');
$example->Emboss('0x1');
push(@$images,$example);
print "Equalize...\n";
$example=$model->Clone();
$example->Label('Equalize');
$example->Equalize();
push(@$images,$example);
print "Implode...\n";
$example=$model->Clone();
$example->Label('Explode');
$example->Implode(-1);
push(@$images,$example);
print "Flip...\n";
$example=$model->Clone();
$example->Label('Flip');
$example->Flip();
push(@$images,$example);
print "Flop...\n";
$example=$model->Clone();
$example->Label('Flop');
$example->Flop();
push(@$images,$example);
print "Frame...\n";
$example=$model->Clone();
$example->Label('Frame');
$example->Frame('15x15+3+3');
push(@$images,$example);
print "Fx...\n";
$example=$model->Clone();
$example->Label('Fx');
push(@$images,$example->Fx(expression=>'0.5*u'));
print "Gamma...\n";
$example=$model->Clone();
$example->Label('Gamma');
$example->Gamma(1.6);
push(@$images,$example);
print "Gaussian Blur...\n";
$example=$model->Clone();
$example->Label('Gaussian Blur');
$example->GaussianBlur('0.0x1.5');
push(@$images,$example);
print "Gradient...\n";
$gradient=Image::Magick->new;
$gradient->Set(size=>'130x194');
$x=$gradient->ReadImage('gradient:#20a0ff-#ffff00');
warn "$x" if "$x";
$gradient->Label('Gradient');
push(@$images,$gradient);
print "Grayscale...\n";
$example=$model->Clone();
$example->Label('Grayscale');
$example->Set(type=>'grayscale');
push(@$images,$example);
print "Implode...\n";
$example=$model->Clone();
$example->Label('Implode');
$example->Implode(0.5);
push(@$images,$example);
print "Level...\n";
$example=$model->Clone();
$example->Label('Level');
$example->Level('20%');
push(@$images,$example);
print "Median Filter...\n";
$example=$model->Clone();
$example->Label('Median Filter');
$example->MedianFilter();
push(@$images,$example);
print "Modulate...\n";
$example=$model->Clone();
$example->Label('Modulate');
$example->Modulate(brightness=>110,saturation=>110,hue=>110);
push(@$images,$example);
$example=$model->Clone();
print "Monochrome...\n";
$example=$model->Clone();
$example->Label('Monochrome');
$example->Quantize(colorspace=>'gray',colors=>2,dither=>'false');
push(@$images,$example);
print "Morphology...\n";
$example=$model->Clone();
$example->Label('Morphology');
$example->Morphology(method=>'Dilate',kernel=>'Diamond',iterations=>3);
push(@$images,$example);
print "Motion Blur...\n";
$example=$model->Clone();
$example->Label('Motion Blur');
$example->MotionBlur('0x13+10-10');
push(@$images,$example);
print "Negate...\n";
$example=$model->Clone();
$example->Label('Negate');
$example->Negate();
push(@$images,$example);
print "Normalize...\n";
$example=$model->Clone();
$example->Label('Normalize');
$example->Normalize();
push(@$images,$example);
print "Oil Paint...\n";
$example=$model->Clone();
$example->Label('Oil Paint');
$example->OilPaint();
push(@$images,$example);
print "Plasma...\n";
$plasma=Image::Magick->new;
$plasma->Set(size=>'130x194');
$x=$plasma->ReadImage('plasma:fractal');
warn "$x" if "$x";
$plasma->Label('Plasma');
push(@$images,$plasma);
print "Polaroid...\n";
$example=$model->Clone();
$example->Label('Polaroid');
$example->Polaroid(caption=>'Magick',rotate=>-5.0,gravity=>'center');
push(@$images,$example);
print "Quantize...\n";
$example=$model->Clone();
$example->Label('Quantize');
$example->Quantize();
push(@$images,$example);
print "Radial Blur...\n";
$example=$model->Clone();
$example->Label('Radial Blur');
$example->RadialBlur(10);
push(@$images,$example);
print "Raise...\n";
$example=$model->Clone();
$example->Label('Raise');
$example->Raise('10x10');
push(@$images,$example);
print "Reduce Noise...\n";
$example=$model->Clone();
$example->Label('Reduce Noise');
$example->ReduceNoise();
push(@$images,$example);
print "Resize...\n";
$example=$model->Clone();
$example->Label('Resize');
$example->Resize('60%');
push(@$images,$example);
print "Roll...\n";
$example=$model->Clone();
$example->Label('Roll');
$example->Roll(geometry=>'+20+10');
push(@$images,$example);
print "Rotate...\n";
$example=$model->Clone();
$example->Label('Rotate');
$example->Rotate(45);
push(@$images,$example);
print "Sample...\n";
$example=$model->Clone();
$example->Label('Sample');
$example->Sample('60%');
push(@$images,$example);
print "Scale...\n";
$example=$model->Clone();
$example->Label('Scale');
$example->Scale('60%');
push(@$images,$example);
print "Segment...\n";
$example=$model->Clone();
$example->Label('Segment');
$example->Segment();
push(@$images,$example);
print "Shade...\n";
$example=$model->Clone();
$example->Label('Shade');
$example->Shade(geometry=>'30x30',gray=>'true');
push(@$images,$example);
print "Sharpen...\n";
$example=$model->Clone();
$example->Label('Sharpen');
$example->Sharpen('0.0x1.0');
push(@$images,$example);
print "Shave...\n";
$example=$model->Clone();
$example->Label('Shave');
$example->Shave('10x10');
push(@$images,$example);
print "Shear...\n";
$example=$model->Clone();
$example->Label('Shear');
$example->Shear('-20x20');
push(@$images,$example);
print "Sketch...\n";
$example=$model->Clone();
$example->Label('Sketch');
$example->Set(colorspace=>'Gray');
$example->Sketch('0x20+120');
push(@$images,$example);
print "Sigmoidal Contrast...\n";
$example=$model->Clone();
$example->Label('Sigmoidal Contrast');
$example->SigmoidalContrast("3x50%");
push(@$images,$example);
print "Spread...\n";
$example=$model->Clone();
$example->Label('Spread');
$example->Spread();
push(@$images,$example);
print "Solarize...\n";
$example=$model->Clone();
$example->Label('Solarize');
$example->Solarize();
push(@$images,$example);
print "Swirl...\n";
$example=$model->Clone();
$example->Label('Swirl');
$example->Swirl(90);
push(@$images,$example);
print "Unsharp Mask...\n";
$example=$model->Clone();
$example->Label('Unsharp Mask');
$example->UnsharpMask('0.0x1.0');
push(@$images,$example);
print "Vignette...\n";
$example=$model->Clone();
$example->Label('Vignette');
$example->Vignette('0x20');
push(@$images,$example);
print "Wave...\n";
$example=$model->Clone();
$example->Label('Wave');
$example->Wave('25x150');
push(@$images,$example);
#
# Create image montage.
#
print "Montage...\n";
$montage=$images->Montage(geometry=>'128x160+8+4>',gravity=>'Center',
tile=>'5x+10+200',compose=>'over',background=>'#ffffff',
font=>'Generic.ttf',pointsize=>18,fill=>'#600',stroke=>'none',
shadow=>'true');
$logo=Image::Magick->new();
$logo->Read('logo:');
$logo->Zoom('40%');
$montage->Composite(image=>$logo,gravity=>'North');
print "Write...\n";
$montage->Set(matte=>'false');
$montage->Write('demo.jpg');
print "Display...\n";
$montage->Write('win:');