michal-josef-spacek / image-random Goto Github PK
View Code? Open in Web Editor NEWPerl class for creating random image.
License: BSD 2-Clause "Simplified" License
Perl class for creating random image.
License: BSD 2-Clause "Simplified" License
NAME Image::Random - Perl class for creating random image. SYNOPSIS use Image::Random; my $obj = Image::Random->new(%parameters); my $type = $obj->create($output_path); my ($width, $height) = $obj->sizes($new_width, $new_height); my $type = $obj->type($new_type); METHODS "new" my $obj = Image::Random->new(%parameters); Constructor. * "color" Color of image. Default value is undef. Undefined value means random color. * "debug" Debug mode. Default value is 0. * "height" Height of image. Default value is 1920. * "type" Image type. List of supported types: bmp, gif, jpeg, png, pnm, raw, sgi, tga, tiff Default value is 'bmp'. * "width" Width of image. Default value is 1080. "create" my $type = $obj->create($output_path); Create image. Returns scalar value of supported file type. "sizes" my ($width, $height) = $obj->sizes($new_width, $new_height); Set/Get image sizes. Both parameters are optional, used only for set sizes. Returns actual width and height. "type" my $type = $obj->type($new_type); Set/Get image type. Parameter $new_type is optional, used only for setting. Returns actual type of image. ERRORS new(): Bad background color definition. Use Imager::Color object. Image type '%s' doesn't supported. From Class::Utils: Unknown parameter '%s'. create(): Cannot write file to '$path'. Error, %s Image type '%s' doesn't supported. EXAMPLE use strict; use warnings; use File::Temp qw(tempfile); use Image::Random; # Temporary file. my (undef, $temp) = tempfile(); # Object. my $obj = Image::Random->new; # Create image. my $type = $obj->create($temp); # Print out type. print $type."\n"; # Unlink file. unlink $temp; # Output: # bmp DEPENDENCIES Class::Utils, Error::Pure, File::Basename, Imager, Imager::Color, List::MoreUtils. SEE ALSO Data::Random Perl module to generate random data Image::Select Perl class for creating random image. REPOSITORY <https://github.com/michal-josef-spacek/Image-Random>. AUTHOR Michal Josef Špaček <mailto:[email protected]> <http://skim.cz> LICENSE AND COPYRIGHT © 2013-2021 Michal Josef Špaček BSD 2-Clause License VERSION 0.11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.