App-Photobear
view release on metacpan or search on metacpan
bin/photobear view on Meta::CPAN
api_key=YOUR_API_KEY
Alternatively you can set the environment variable C<PHOTOBEAR_API_KEY> to your API key, or use the --api-key option.
=head1 COMMANDS
The program supports the following commands:
=over 4
=item B<background_removal>
Remove the background from the image specified by the URL.
=item B<vectorization>
Vectorize the image specified by the URL (output in SVG format).
=item B<super_resolution>
Enlarge the image specified by the URL.
=item B<compress>
lib/App/Photobear.pm view on Meta::CPAN
use Carp;
use HTTP::Tiny;
use Data::Dumper;
use JSON::PP;
# Define version
our $VERSION = '0.1.2';
# Define constants
our $PHOTOBEAR_URL = 'https://photobear.io/api/public/submit-photo';
our @MODES = split / /, "background_removal vectorization super_resolution compress";
our $TESTMODE = $ENV{"PHOTOBEAR_TEST"} || 0;
# Export MODES
use Exporter qw(import);
our @EXPORT_OK = qw(loadconfig saveconfig url_exists curl photobear url_type @MODES);
our $TEST_ANSWER = q({"status":"success","data":{"result_url":"https://res.cloudinary.com/dy4s1umzd/image/upload/e_vectorize:colors:20:detail:0.7:corners:20/v1688570702/svg_inp/aia14r/core-people.svg"}});
sub loadconfig {
my $filename = shift;
if (! -e "$filename") {
( run in 1.125 second using v1.01-cache-2.11-cpan-d8267643d1d )