view release on metacpan or search on metacpan
scripts/IM-charcoal view on Meta::CPAN
#!/usr/bin/perl
use warnings;
use strict;
use Image::Magick;
# this will create a nice charcoal sketch of the
# input image. The charcoal can then be "lightened"
# with z-brightner
scripts/IM-charcoal view on Meta::CPAN
my $newtype = 'jpg';
(my $filebase) = $file =~ /(.*)\.(\w+)$/;
print "$filebase\n";
my $p = new Image::Magick;
$p->Read($file);
$p->Charcoal('0x1');
$p->Write($filebase.'-charc.'.$newtype);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tk/Chart/FAQ.pod view on Meta::CPAN
You can use the postscript method canvas (see L<Tk::Canvas>) to create postscript file of your image.
$chart->postscript( -file => "MyFile.ps");
If you want to convert it in gif, jpeg format file for example, you can install L<Image::Magick> module
and Ghostscript (L<http://pages.cs.wisc.edu/~ghost/>).
Example code for postscript file conversion:
use Image::Magick;
my $image_magick = new Image::Magick;
$image_magick->Read("MyFile.ps");
$image_magick->Write("MyFile.png");
=head2 How to zoom the graph in canvas widget ?
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tk/ForDummies/Graph/FAQ.pod view on Meta::CPAN
You can use the postscript method canvas (see L<Tk::Canvas>) to create postscript file of your image.
$GraphDummies->postscript( -file => "MyFile.ps");
If you want to convert it in gif, jpeg format file for example, you can install L<Image::Magick> module
and Ghostscript (L<http://pages.cs.wisc.edu/~ghost/>).
Example code for postscript file conversion:
use Image::Magick;
my $Magick = new Image::Magick;
$Magick->Read("MyFile.ps");
$Magick->Write("MyFile.png");
=head2 How to zoom the graph in canvas widget ?
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tk/VisualBrowser.pm view on Meta::CPAN
return $image_filename;
}
It could also be arranged that the thumbnail_handler creates the GIF
images when they do not yet exist. So the viewing of an image directory
would automatically create the thumbnails (with Image::Magick, for example).
NOTE: The names in the @PICTURES array need not be valid filenames,
although they normally are. The names of the GIF files
provided by the thumbnail_handler must be valid filenames,
either relative to the current working directory or absolute
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tree/Cladogram.pm view on Meta::CPAN
=pod
=head1 NAME
C<Tree::Cladogram> - Render a cladogram using Imager or Image::Magick
=head1 Synopsis
This is scripts/imager.pl:
lib/Tree/Cladogram.pm view on Meta::CPAN
Sample input is shipped as data/*.clad.
The corresponding output is shipped as data/*.png, and is on-line:
L<wikipedia.01.clad output by Imager|http://savage.net.au/misc/wikipedia.01.png>
L<wikipedia.01.clad output by Image::Magick|http://savage.net.au/misc/wikipedia.02.png>
L<nationalgeographic.01.clad output by Imager|http://savage.net.au/misc/nationalgeographic.01.png>
L<nationalgeographic.01.clad output by Image::Magick|http://savage.net.au/misc/nationalgeographic.02.png>
=head1 Distributions
This module is available as a Unix-style distro (*.tgz).
lib/Tree/Cladogram.pm view on Meta::CPAN
Specify non-production effects.
Currently, the only extra effect is to draw fuchsia boxes around the leaf names.
Frankly, this helped me debug the L<Image::Magick> side of things.
Default: 0 (no extra effects).
=item o draw_frame => $Boolean
lib/Tree/Cladogram.pm view on Meta::CPAN
=item o leaf_font_file => $string
Specify the name of the font file to use for the names of the leaves.
You can use path names, as per the default, or - using Image::Magick -, you can just use the name
of the font, such as 'DejaVu-Sans-ExtraLight'.
Default: '/usr/share/fonts/truetype/freefont/FreeMono.ttf'.
=item o leaf_font_size => $integer
lib/Tree/Cladogram.pm view on Meta::CPAN
=item o output_file => $string
Specify the name of the image file to write.
Image formats supported are anything supported by L<Imager> or L<Image::Magick>.
See the L</What image formats are supported?> for details.
Default: '' (no output).
=item o print_tree => $Boolean
lib/Tree/Cladogram.pm view on Meta::CPAN
=item o title_font_file => $string
Specify the name of the font file to use for the title.
You can use path names, as per the default, or - using Image::Magick -, you can just use the name
of the font, such as 'DejaVu-Sans-ExtraLight'.
Default: '/usr/share/fonts/truetype/freefont/FreeSansBold.ttf'.
=item o title_font_size => $integer
lib/Tree/Cladogram.pm view on Meta::CPAN
=head2 leaf_font_file([$string])
Get or set the name of the font file used for leaf names.
You can use path names, as per the default, or - using Image::Magick -, you can just use the name
of the font, such as 'DejaVu-Sans-ExtraLight'.
C<leaf_font_file> is a parameter to L</new()>.
=head2 leaf_font_size([$integer])
lib/Tree/Cladogram.pm view on Meta::CPAN
=head2 title_font_file([$string])
Get or set the name of the font file used for the title.
You can use path names, as per the default, or - using Image::Magick -, you can just use the name
of the font, such as 'DejaVu-Sans-ExtraLight'.
C<title_font_file> is a parameter to L</new()>.
=head2 title_font_size([$integer])
lib/Tree/Cladogram.pm view on Meta::CPAN
A simple way for me to convert the docs into HTML.
=item o test.image.magick.pl
Outputs data/test.image.magick.png. I used this program to experiment with L<Image::Magick> while
converting Tree::Cladogram::Imager into Tree::Cladogram::ImageMagick.
=item o test.image.magick.sh
A convenient way to run test.image.magick.pl.
lib/Tree/Cladogram.pm view on Meta::CPAN
This is the output of rendering nationalgeographic.01.clad with L<Imager>.
=item o nationalgeographic.02.png
This is the output of rendering nationalgeographic.01.clad with L<Image::Magick>.
=item o test.image.magick.png
The is is output of scripts/test.image.magick.pl.
lib/Tree/Cladogram.pm view on Meta::CPAN
This is the output of rendering wikipedia.01.clad with L<Imager>.
=item o wikipedia.02.png
This is the output of rendering wikipedia.01.clad with L<Image::Magick>.
=back
=head1 FAQ
lib/Tree/Cladogram.pm view on Meta::CPAN
1 below 2
2 above Butterflies, moths
2 below Flies
Output: L<Using Imager|http://savage.net.au/misc/wikipedia.01.png> and
L<using Image::Magick|http://savage.net.au/misc/wikipedia.02.png>.
Sample 2 - L<http://phenomena.nationalgeographic.com/2015/12/11/paleo-profile-the-smoke-hill-bird/>:
+--- Archaeopterix lithographica
|
lib/Tree/Cladogram.pm view on Meta::CPAN
11 below 12
12 above Parahesperornis alexi
12 below Hesperornis regalis
Output: L<Using Imager|http://savage.net.au/misc/nationalgeographic.01.png> and
L<using Image::Magick|http://savage.net.au/misc/nationalgeographic.02.png>.
File format:
=over 4
lib/Tree/Cladogram.pm view on Meta::CPAN
=head2 Which versions of the renderers did you use?
L<Imager> V 1.004.
L<Image::Magick> V 6.9.3-0 Q16.
For help installing Image::Magick under Debian, see
L<http://savage.net.au/ImageMagick/html/Installation.html>.
=head2 What image formats are supported?
My default install of L<Imager> lists:
lib/Tree/Cladogram.pm view on Meta::CPAN
ifs
png
pnm
raw
L<Image::Magick> supports a huge range of formats (221 actually). To list them, run
scripts/test.image.magick.pl. Note: This program writes to data/test.image.magick.png.
=head2 What colors are supported?
See L<Imager::Color> for Imager's docs on color. But you're probably better off using
L<Image::Magick>'s table mentioned next, since my module only accepts colors. It does not allow
you to provide an Imager::Color object as a parameter.
See L<Image::Magick colors|http://www.imagemagick.org/script/color.php> for a huge table of both
names and hex values.
=head2 What fonts are supported?
Check these directories:
lib/Tree/Cladogram.pm view on Meta::CPAN
L<Bio::Tree::Draw::Cladogram>
L<Imager>
L<Image::Magick>
L<Help installing Image::Magick|http://savage.net.au/ImageMagick/html/Installation.html>
L<Tree::DAG_Node>
=head1 Machine-Readable Change Log
view all matches for this distribution
view release on metacpan or search on metacpan
Quicktime_PL.pm view on Meta::CPAN
if (length($file->pict)>0) {
print "Outputing PICT file\n";
my $oi = 'eg/mov_preview.pict';
open(O,">$oi") || warn("Couldn't open $oi: $!\n");
binmode(O); # set the file to binary mode in working on Windows
# Image::Magick methods will only recognize this file as
# PICT if there exists a leading header of zeros:
print O "\x00" x 512;
print O $file->pict;
close(O);
}
view all matches for this distribution
view release on metacpan or search on metacpan
cgi-bin/apache-magick.cgi view on Meta::CPAN
#!/usr/bin/perl -w
use strict;
use Image::Magick;
use constant DEBUG =>0;
use Smart::Comments '###';
use File::Copy;
use File::Path;
my %LegalArguments = map { $_ => 1 } qw(
cgi-bin/apache-magick.cgi view on Meta::CPAN
# READ IMAGE
my $q = new Image::Magick;
$err = $q->Read($abs_path);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/MeGa.pm view on Meta::CPAN
The file named like that will be skipped when showing the content of the folder.
=head3 thumb-type
Type of the thumbnails.
L<WWW::MeGa> uses L<Image::Magick> for generating thumbnails.
See C<convert -list format> for file types supported by you ImageMagick
installation.
=head3 video-thumbs
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WWW/StreetMap.pm view on Meta::CPAN
use strict;
use vars qw($VERSION);
# Standard Perl Library and CPAN modules
use File::Temp qw(tempfile);
use Image::Magick;
use IO::All;
use IO::All::LWP;
use OpenOffice::OODoc;
lib/WWW/StreetMap.pm view on Meta::CPAN
map { s! ^.*SRC="([^"]+)".*$ !$1!x } @image_urls;
my @filenames = ();
my $image = Image::Magick->new;
foreach my $url (@image_urls) {
my ($fh, $filename) = tempfile(SUFFIX=>'gif');
chomp $url;
io($url) > io($filename);
$image->Read($filename);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WebService/Images/Nofrag.pm view on Meta::CPAN
use warnings;
use strict;
use Carp;
use WWW::Mechanize;
use base qw(Class::Accessor::Fast);
use Image::Magick;
use Image::Magick::Info qw( get_info );
use LWP::Simple;
WebService::Images::Nofrag->mk_accessors( qw(thumb image url) );
=head1 NAME
lib/WebService/Images/Nofrag.pm view on Meta::CPAN
getstore( $$params{ url }, $tempory_file );
}
# do we need to resize ?
if ( defined $$params{ resize } ) {
my $img = new Image::Magick;
if ( -f $tempory_file ) {
$img->Read( $tempory_file );
} else {
$img->Read( $$params{ file } );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/WebService/Rajce.pm view on Meta::CPAN
use WWW::Mechanize;
use XML::Simple;
use Digest::MD5 qw(md5_hex);
use Encode;
use Image::Magick;
use Carp;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
require Exporter;
lib/WebService/Rajce.pm view on Meta::CPAN
sub add_photo {
my ($self,$filename,$album) = @_;
my $thumbsize = "100x100";
my $thumb = new Image::Magick;
$thumb->Read($filename);
$thumb->AutoOrient();
$thumb->Resize(geometry=>"$thumbsize^");
$thumb->Crop(gravity=>"Center",geometry=>"$thumbsize");
$thumb->Strip();
my $pic = new Image::Magick;
$pic->Read($filename);
$pic->AutoOrient();
$pic->Resize(geometry=>"$self->{maxWidth}x$self->{maxHeight}>");
if(!$self->{KEEP_EXIF}){
view all matches for this distribution
view release on metacpan or search on metacpan
lib/modules/ImagePwd.pm view on Meta::CPAN
package ImagePwd;
use Image::Magick;
use strict;
##############################################
# ImagePwd module written by Julian Lishev
# This module is part of WebTools package!
# Privacy and terms are same as WebTools!
##############################################
# Prerequirment: Image::Magick (PerlMagick)
##############################################
=head2 $img = ImagePwd::new (%inp);
lib/modules/ImagePwd.pm view on Meta::CPAN
push (@pnts,$sz);
$i_x += $sz;
}
my $addl = $cx;
$cx = ($width/2) - (($i_x+$a_cx)/2);
my $image = Image::Magick->new(compression=>'LosslessJPEG',quality=>$quality);
$image->Set(size=>$width.'x'.$height);
my $bgcolor = $f_bgcolor || _generatebgcolor();
my $color = $f_color || _choosecolor($bgcolor);
$image->Set(antialias=>'True');
$image->ReadImage('xc:'.$bgcolor);
view all matches for this distribution
view release on metacpan or search on metacpan
CaptureIE.pm view on Meta::CPAN
=head1 DESCRIPTION
The package enables you to automatically create screenshots of your
web server pages for the user guide or whatever you need it for. The
best part is that you don't bother yourself with scrolling and object
localization. Just tell the ID of the element and receive an Image::Magick
object. The package will do all the scrolling work, it will take the
screenshots and glue the parts together.
=head1 EXPORT
view all matches for this distribution
view release on metacpan or search on metacpan
Screenshot.pm view on Meta::CPAN
}
require XSLoader;
XSLoader::load('Win32::Screenshot', $VERSION);
use Image::Magick;
our @POST_PROCESS;
sub ppResize {
my $ratio = shift || 0.74;
Screenshot.pm view on Meta::CPAN
$width ||= 17;
my $top = sprintf "%.0f", $width/3.4;
# prepare background
my ($w, $h) = $_->Get('width', 'height');
my $g = Image::Magick->new;
$g->Set(size=>($w+$width).'x'.($h+$width));
$g->ReadImage('xc:'.$outer);
$g->Draw(
stroke=>$inner,
fill=>$inner,
Screenshot.pm view on Meta::CPAN
sub _capture {
CreateImage( CaptureHwndRect(@_) );
}
sub CreateImage {
my $image=Image::Magick->new();
$image->Set(magick=>'rgba');
$image->Set(size=>"$_[0]x$_[1]");
$image->Set(depth=>8);
$image->BlobToImage($_[2]);
Screenshot.pm view on Meta::CPAN
$image = CaptureRect( $x, $y, $width, $height );
$image->Write('screenshot.png');
=head1 DESCRIPTION
The package utilizes some Win32 API function and L<Image::Magick|Image::Magick>
to let you capture the screen, a window or a part of it. The
C<Capture*(...)> functions returns a new L<Image::Magick|Image::Magick> object which
you can easily use to modify the screenshot or to store it in the
file. You can define your own post processing handlers and chain them in
the list.
There are Perl equivalents of Win32 API functions for working with
windows implemented in the package. These functions will allow easy
identification of windows on the screen.
=head2 Image post-processing
The handler receives a reference to an Image::Magick object. If the
handler returns such reference it will be used instead of the input
one for further processing. It means that the handler can return
completely different image.
The handlers are organized in a list @POST_PROCESS. The item of the
Screenshot.pm view on Meta::CPAN
=back
=head2 Screen capture functions
All these functions return a new L<Image::Magick|Image::Magick> object
on success or undef on failure. These function are exported by default.
=over 8
=item CaptureRect( $x, $y, $width, $height )
Screenshot.pm view on Meta::CPAN
The function joins two bitmaps of the same height and return
the new bitmap data.
=item CreateImage( $width, $height, $rawdata )
Creates a new Image::Magick object from provided data and
calls all listed post-processing handlers. The function
returns the processed object.
=item PostProcessImage( $image )
Screenshot.pm view on Meta::CPAN
=back
=head2 Post-processing handlers
See L<Image::Magick> for other image processing functions. Typically
you can use methods like C<Label>, C<Quantize> and C<Set> to post-process
all captured images and then simply C<Write> the image to the file.
push @POST_PROCESS, sub {
$_[0]->Quantize( colors=>80, dither=>0 );
Screenshot.pm view on Meta::CPAN
=item Win32::GUI
It was a good inspiration for me. I borrowed some code from the module.
=item Image::Magick
The raw data from the screen are loaded into Image::Magick object. You
have a lot of possibilities what to do with the captured image.
=item MSDN
http://msdn.microsoft.com/library
view all matches for this distribution
view release on metacpan or search on metacpan
ShellExt/ColumnProvider/JpgSize.pm view on Meta::CPAN
use 5.006;
use strict;
use warnings;
use Win32::ShellExt::ColumnProvider 0.1;
use Image::Magick 5.41;
$Win32::ShellExt::ColumnProvider::JpgSize::VERSION='0.1';
@Win32::ShellExt::ColumnProvider::JpgSize::ISA=qw(Win32::ShellExt::ColumnProvider);
$ENV{MAGICK_HOME}="C:\\perl\\bin";
ShellExt/ColumnProvider/JpgSize.pm view on Meta::CPAN
sub get_item_data_height() {
my ($self,$file) = @_;
&log("get_item_data_height",$file);
return undef if($file!~m!jpg$!i) ;
my $img = new Image::Magick;
$img->Read($file);
my $s = $img->GetAttribute('height');
&log("get_item_data_height",$s);
$s;
}
sub get_item_data_width() {
my ($self,$file) = @_;
&log("get_item_data_width",$file);
return undef if($file!~m!jpg$!i) ;
my $img = new Image::Magick;
$img->Read($file);
my $s = $img->GetAttribute('width');
&log("get_item_data_width",$s);
$s;
}
view all matches for this distribution
view release on metacpan or search on metacpan
build_requires:
ExtUtils::MakeMaker: 0
requires:
Date::Simple: 0
File::Type: 0
Image::Magick: 0
LEOCHARRE::CLI: 0
MIME::Base64: 0
Smart::Comments: 0
XMLRPC::Lite: 0
YAML: 0
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
use warnings;
our $VERSION = '0.02';
use Wx qw(wxNullBitmap);
use Image::Magick;
use IO::Scalar;
use Wx::Perl::Carp qw(cluck);
use base 'Clone';
#----------------------------------------------------------------------
# Compatibility methods for Wx::Image
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
sub new
{
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self->{_im} = Image::Magick->new();
# When we convert the Wx::Perl::Imagick object to a Wx::Bitmap we convert
# it to PNG first...so we need the PNGHandler
Wx::Image::AddHandler(Wx::PNGHandler->new);
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
my ($self, $x, $y, $r, $g, $b) = @_;
$self->Set("pixel[$x,$y]", sprintf('#%02x%02x%02x', $r,$g,$b));
}
#----------------------------------------------------------------------
# Compatibility methods for Image::Magick
#
our ($AUTOLOAD);
sub AUTOLOAD
{
my $self = shift;
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
#
sub MagickError
{
my $self = shift;
my $error = shift;
cluck "Image::Magick returned an error: \n$error" if $error;
}
sub SetIndex
{
$_[0]->{_index} = $_[1];
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
}
=head1 NAME
Wx::Perl::Imagick - A drop-in replacement for Wx::Image with all functionality of Image::Magick
=head1 VERSION
Version 0.01
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
my $fromicon = Wx::Perl::Imagick->new($icon);
my $anotherbitmap = $fromicon->ConvertToBitmap;
$bmp = Wx::StaticBitmap->new($panel, -1, $anotherbitmap, [500,500]) if $anotherbitmap->Ok;
...
# Now it's also possible to use Image::Magick's conversions and filters
$magick->->Crop(geometry=>'100x100"+100"+100');
...
=head1 DESCRIPTION
This class is meant to be a replacement for Wx::Image, adding all functionality of Image::Magick. Hence
the name Wx::Perl::Imagick.
Most of the API of Wx::Image has been copied for backwards compatibility, but you can also call any method
of Image::Magick on a constructed Wx::Perl::Magick instance. This will greatly improve the possibilities
you have with an image in wxPerl.
=head1 INCOMPATIBILITIES
While I've tried to keep all methodcalls that Wx::Image knows the same for Wx::Perl::Imagick, there are
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
generated from Wx::Image's GetData), using the given width and height.
=item Wx::Perl::Imagick->new(file, (mime)type, index = 0)
This will load the file indicated. If a mimetype or type is supplied, the constructor will
generate a print STDERRing, because Wx::Perl::Imagick lets Image::Magick figure out the type of the file, and
ignores this parameter.
The index points out which of the images that the indicated file provides will be the default one.
To use this form without print STDERRings, you'd better call it like this:
Wx::Perl::Imagick->new('somefile.jpg', undef, 0); # you can omit the last two parameters if you like
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
This method does nothing. Wx::Perl::Magick does not use wxWidget's ImageHandlers;
=head2 ComputeHistogram
Unlike wxPerl, Wx::Perl::Imagick does implement it, albeit just an alias for Image::Magick's Histogram() method.
It returns the unique colors in the image and a count for each one. The returned values are an array of
red, green, blue, opacity, and count values.
=head2 ConvertToBitmap
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
Returns 1 if there is a mask active, 0 otherwise.
=head2 GetOption
This is implemented in a different manner than in Wx::Image. It is in fact an alias for Image::Magick's
Get() method. The suggested option 'quality' in the Wx::Image documentation works perfectly with GetOption('quality').
Since this method not documented any further in the wxWidgets documentation, I implemented it this way.
It can however return anything that Image::Magick returns (being a string or an integer)
=head2 GetOptionInt
See GetOption.
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
This method does nothing. Wx::Perl::Magick does not use wxWidget's ImageHandlers;
=head2 LoadFile(filename)
This loads the file indicated by filename. The second parameter that Wx::Image specifies is ignored (the filetype),
since Image::Magick doesn't need any specification of the filetype.
=head2 Ok
This returns 1 if an image has been loaded. Returns 0 otherwise.
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
This method does nothing. Wx::Perl::Magick does not use wxWidget's ImageHandlers;
=head2 SaveFile
This saves the image to a file named filename. The second parameter that Wx::Image specifies is ignored (the filetype),
since Image::Magick doesn't need any specification of the filetype.
=head2 Mirror(horizontally = 1)
Returns a mirrored copy of the image. The parameter horizontally indicates the orientation.
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
see Scale();
=head2 Rotate
Rotate is an Image::Magick method. To prevent name conflicts, the Wx::Image compatibility function
has not been implemented. Image::Magick's Rotate knows the following parameters:
=over 4
=item degrees => double
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
Returns a copy of the image rotated 90 degrees in the direction indicated by clockwise.
=head2 Scale
Scale is an Image::Magick method. To prevent name conflicts, the Wx::Image compatibility function
has not been implemented. Image::Magick's Scale knows the following parameters:
=over 4
=item geometry => geometry
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
Specifies whether there is a mask or not.
=head2 SetMaskColour
This sets the transparent color of the current image. For some reason, after setting the MaskColour you
cannot retrieve the color you just set with GetMaskRed, GetMaskGreen and GetMaskBlue. This seems to be a bug in Image::Magick.
If you save the image after setting the MaskColour, it does use the color you indicated for transparency.
=head2 SetMaskFromImage
Not implemented
=head2 SetOption
This is implemented in a different manner than in Wx::Image. It is in fact an alias for Image::Magick's
Set() method. The suggested option 'quality' in the Wx::Image documentation works perfectly with SetOption(quality => 100).
Since this method not documented any further in the wxWidgets documentation, I implemented it this way.
=head2 SetPalette
lib/Wx/Perl/Imagick.pm view on Meta::CPAN
=head2 SetRGB(x, y, red, green, blue)
Sets the pixel at the given coordinate to the given red, green and blue values.
=head1 Image::Magick compatible METHODS
You can call any Image::Magick method on any Wx::Perl::Imagick object. The module tries to AUTOLOAD the
Image::Magick method and returns the output immediately. See the documentation of Image::Magick at
L<http://www.imagemagick.org/script/perl-magick.php>
=head1 CONVENIENCE METHODS
There are a few methods I've added that are neither part of Wx::Image, nor of Image::Magick.
They are just for convenience:
=head2 MagickError
If you perform an Image::Magick operation, you may want to call it like this:
my $img = Wx::Perl::Imagick->new('someimage.jpg');
$img->MagickError( $img->Resize(geometry => '100x100');
This will output the error if Image::Magick encounters anything.
=head2 SetIndex
If you load an imagefile that contains multiple images, you can call SetIndex to indicate
on which of the images you want to perform the action. For example:
view all matches for this distribution
view release on metacpan or search on metacpan
ImageCache.pm view on Meta::CPAN
use XAO::FS;
use XAO::Errors qw(XAO::ImageCache);
use Digest::MD5 qw(md5 md5_hex md5_base64);
use LWP::UserAgent;
use URI;
use Image::Magick;
use Date::Manip;
use File::Path;
use File::Copy;
use vars qw($VERSION);
ImageCache.pm view on Meta::CPAN
return;
}
my $geometry = ''; # image dimensions in ImageMagick geometry format
my $image = Image::Magick->new() || $self->throw("- Image::Magick creation failure!");
my $err = $image->ReadImage($infile);
### dprint ".source in '$infile'";
# Only throwing an error if no image was read. If we consider all
# warnings as errors then some 3M tiff files don't parse.
ImageCache.pm view on Meta::CPAN
To get cached image name
=item size
- Prefered image size may set as C<geometry> equal to C<geometry> parameter
of Image::Magick module to pass it dirrectly to Image::Magick Scale function.
Other way to set the image size is set a width and height keys to preffered
values.
If one of image dimension is not defined then corresponding parameter of
ImageCache.pm view on Meta::CPAN
L<XAO::DO::FS::Global>,
L<XAO::DO::FS::Glue::MySQL_DBI>,
Refer to L<Image::Magick> documentation for additional
information about setting of image scaling parameters.
Refer to L<LWP::UserAgent> documentation for additional
information about user agent parameters.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XML/Filter/XML_Directory_2XHTML.pm view on Meta::CPAN
use strict;
package MySAX;
use base qw (XML::SAX::Base);
use Image::Magick;
sub parse_uri {
my $self = shift;
my $uri = shift;
my $magick = Image::Magick->new();
if (my $err = $magick->Read($uri)) {
carp $err;
return 0;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/XUL/Image.pm view on Meta::CPAN
FindWindowLike GetWindowText
SetForegroundWindow SendKeys
);
use Clipboard;
use File::Spec;
use Image::Magick;
our $VERSION = '0.03';
has 'title' => (is => 'ro', isa => 'Str', default => 'Mozilla');
has 'count' => (is => 'ro', isa => 'Int', required => 1);
lib/XUL/Image.pm view on Meta::CPAN
SendKeys("{F11}");
}
sub crop_img {
my ($self, $imdata, $outfile) = @_;
my $image = Image::Magick->new;
$image->BlobToImage($imdata);
my $ret = $image->Crop( geometry => '+0+33' );
warn $ret if $ret;
$ret = $image->Trim;
warn $ret if $ret;
view all matches for this distribution
view release on metacpan or search on metacpan
ZooZ/icons/convert.pl view on Meta::CPAN
#!perl -w
use strict;
use Image::Magick;
for my $f (<*.bmp>) {
my $im = new Image::Magick;
$im->Read($f);
my $g = $f;
$g =~ s/\.bmp/.gif/;
$im->Write($g);
view all matches for this distribution
view release on metacpan or search on metacpan
bin/dvdrip-subpng view on Meta::CPAN
sub convert_im {
my ($file_pgm) = @_;
my $file_png = $file_pgm;
$file_png =~ s/pgm$/png/;
require Image::Magick;
my $image = Image::Magick->new;
$image->Read($file_pgm);
$image->Write($file_png);
print STDERR "Write: $file_png\n";
unlink $file_pgm;
1;
view all matches for this distribution
view release on metacpan or search on metacpan
HTML/Latex.pm view on Meta::CPAN
$present{'URI'} = 1 unless $@;
eval {require LWP::Simple};
$present{'LWP::Simple'} = 1 unless $@;
eval {require Image::Magick};
$present{'Image::Magick'} = 1 unless $@;
# The configuration file gives a "type" to each tag. This hash tells
# what functions to use on each type
my %types = (
"command" => \&command_handler,
HTML/Latex.pm view on Meta::CPAN
my ($aname,$apath,$asuffix) = fileparse($absolute,'\.(gif|png|jpe?g)');
my ($rname,$rpath,$rsuffix) = fileparse($relative,'\.(gif|png|jpe?g)');
if($asuffix eq '.gif' || $asuffix eq '.jpg' || $asuffix eq '.jpeg'){ #
# Picture is of a convertable type
if($present{'Image::Magick'}){
# convert it with Image::Magick
require Image::Magick;
my $aoutput = "$apath$aname.png"; #write to and return with png
my $routput = "$rpath$rname.png";
my $image = Image::Magick->new();
$image->Read("$absolute");
$image->Write("$aoutput");
undef $image;
print $LOG "IMG: Converted $source to $routput\n";
return $routput;
} else {
# No Image::Magick. Warn user and return nothing.
print $LOG "IMG: Can't convert $source without Image::Magick; using alt\n";
return;
}
} elsif ($asuffix eq '.png'){
# It's a PNG for sure.
my $routput = "$rpath$rname.png";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/jQuery/File/Upload/Imager.pm view on Meta::CPAN
=head3 tumbnail_quality
$j_fu->thumbnail_quality(70);
This sets the quality of the generated thumbnail. Default is 70 and it
can be on a scale of 0-100. See L<Image::Magick> for more information.
=head3 thumbnail_quality
$j_fu->thumbnail_quality(70);
This sets the quality of the thumbnail image. Default is 70 and it
can be on a scale of 0-100. See L<Image::Magick> for more information.
=head3 thumbnail_format
$j_fu->thumbnail_format('jpg');
Sets the format for the generated thumbnail. Can be jpg, png, or gif.
See L<Image::Magick> for more information. Defaults to jpg.
=head3 thumbnail_density
$j_fu->thumbnail_density('80x80');
Sets the density for the generated thumbnail. Default is width x height.
See L<Image::Magick> for more information.
=head3 thumbnail_prefix
$j_fu->thumbnail_prefix('thumb_');
lib/jQuery/File/Upload/Imager.pm view on Meta::CPAN
=head3 quality
$j_fu->quality(70);
This sets the quality of the uploaded image. Default is 70 and it
can be on a scale of 0-100. See L<Image::Magick> for more information.
=head3 format
$j_fu->format('jpg');
Sets the format for the generated thumbnail. Can be jpg,png, or gif.
See L<Image::Magick> for more information. Defaults to jpg.
=head3 final_width
my $final_width = $j_fu->final_width;
lib/jQuery/File/Upload/Imager.pm view on Meta::CPAN
=head1 AUTHOR
Adam Hopkins, E<lt>srchulo@cpan.org<gt>
Ron Savage I<E<lt>ron@savage.net.auE<gt>> has patched jQuery::File::Upload V 0.16
to use L<Imager> rather than L<Image::Magick>, on 2013-05-23. See the L</FAQ> for details.
=head1 Bugs
I haven't tested this too thoroughly beyond my needs, so it is possible
that I have missed something. If I have, please feel free to submit a bug
view all matches for this distribution
view release on metacpan or search on metacpan
lib/jQuery/File/Upload.pm view on Meta::CPAN
use CGI;
use JSON::XS;
use JSON;
use Net::SSH2;
use Net::SSH2::SFTP;
use Image::Magick;
use Cwd 'abs_path';
use URI;
use Data::GUID;
#use LWP::UserAgent;
lib/jQuery/File/Upload.pm view on Meta::CPAN
sub _set_image_magick {
my $self = shift;
return unless $self->is_image;
#if used in persistent setting, don't recreate object
$self->{image_magick} = Image::Magick->new unless defined $self->{image_magick};
$self->{image_magick}->Read(file => $self->{fh});
return $self->{image_magick};
}
lib/jQuery/File/Upload.pm view on Meta::CPAN
=head3 thumbnail_quality
$j_fu->thumbnail_quality(70);
This sets the quality of the thumbnail image. Default is 70 and it
can be on a scale of 0-100. See L<Image::Magick> for more information.
=head3 thumbnail_format
$j_fu->thumbnail_format('jpg');
Sets the format for the generated thumbnail. Can be jpg, png, or gif.
See L<Image::Magick> for more information. Defaults to jpg.
=head3 thumbnail_density
$j_fu->thumbnail_density('80x80');
Sets the density for the generated thumbnail. Default is width x height.
See L<Image::Magick> for more information.
=head3 thumbnail_prefix
$j_fu->thumbnail_prefix('thumb_');
lib/jQuery/File/Upload.pm view on Meta::CPAN
=head3 quality
$j_fu->quality(70);
This sets the quality of the uploaded image. Default is 70 and it
can be on a scale of 0-100. See L<Image::Magick> for more information.
=head3 process_images
$j_fu->process_images(1);
lib/jQuery/File/Upload.pm view on Meta::CPAN
=head3 format
$j_fu->format('jpg');
Sets the format for the generated thumbnail. Can be jpg,png, or gif.
See L<Image::Magick> for more information. Defaults to jpg.
=head3 final_width
my $final_width = $j_fu->final_width;
lib/jQuery/File/Upload.pm view on Meta::CPAN
L<Net::SSH2::SFTP>
=item
L<Image::Magick>
=item
L<Cwd>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/HTML/KhatGallery.pm view on Meta::CPAN
File::Spec
Cwd
File::stat
YAML
Image::Info
Image::Magick
=head1 INSTALLATION
To install this module, run the following commands:
view all matches for this distribution
view release on metacpan or search on metacpan
cpan/CPAN-Meta/t/data-fixable/284247103-META.yml view on Meta::CPAN
requires:
Text::VimColor: 0.09
- picture-article:
description: Publish pictures as articles, with automatic thumbnails
requires:
Image::Magick: 0
- related-links:
description: Add a Related Links box to pages for articles
requires:
Template::Plugin::Class: 0
view all matches for this distribution
view release on metacpan or search on metacpan
devel/icons.pl view on Meta::CPAN
use Locale::TextDomain ('App-RSS2Leafnode');
use Smart::Comments;
{
require Image::Magick;
open my $fh, '<', '/tmp/favicon.ico' or die;
my $bytes = do { local $/; <$fh> }; # slurp
close $fh or die;
my $im = Image::Magick->new (magick => 'ico');
my @info = $im->Ping(blob=>$bytes);
### @info
@info = $im->Ping('/tmp/xx');
### @info
@info = $im->Ping('/tmp/favicon.ico');
### @info
exit 0;
}
{
require Image::Magick;
my $im = Image::Magick->new;
# $im->Read('/usr/share/icons/hicolor/48x48/apps/emacs.png');
my $ret = $im->Read('/tmp/favicon.icoxxy');
### $ret
# open my $fh, '<', '/tmp/favicon.ico' or die;
# my $bytes = do { local $/; <$fh> }; # slurp
# close $fh or die;
# my $im = Image::Magick->new (mime=>'image/x-icon');
# # $im->Set(mime=>'image/x-ico');
# # 'image/vnd.microsoft.icon'
# # my $im = Image::Magick->new (magick=>'ico');
# my $ret = $im->BlobToImage ($bytes);
# ### $ret
# $im->Set(magick => 'xbm');
# # $im->Set(-compress => 'none');
devel/icons.pl view on Meta::CPAN
exit 0;
}
# sub image_size {
# if (eval { require Image::ExifTool }) {
# } elsif (eval { require Image::Magick }) {
# }
sub imagemagick_to_x_face {
my ($self, $type, $data) = @_;
eval { require Image::XFace } or return;
view all matches for this distribution
view release on metacpan or search on metacpan
cpansmokebox/bin/cpan2dist view on Meta::CPAN
^Berk.*DB # DB packages require specific options & linking
^DBD:: # DBD drivers require database files/headers
^XML:: # XML modules usually require expat libraries
Apache # These usually require apache libraries
SSL # These usually require SSL certificates & libs
Image::Magick # Needs ImageMagick C libraries
Mail::ClamAV # Needs ClamAV C Libraries
^Verilog # Needs Verilog C Libraries
^Authen::PAM$ # Needs PAM C libraries & Headers
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/threads/tbb/refcounter.pod view on Meta::CPAN
threads::tbb::refcounter - inside-out refcounts for XS types
=head1 SYNOPSIS
use threads::tbb::refcounter qw(Image::Magick);
# alternately:
use threads::tbb::refcounter;
threads::tbb::refcounter->setup("Some::XS::Type");
view all matches for this distribution