Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Executing external programs

by Silt (Novice)
on Feb 19, 2019 at 05:50 UTC ( #1230138=note: print w/replies, xml ) Need Help??


in reply to Re: Executing external programs
in thread Executing external programs

Okay, let me try to rephrase my question then:
I want to make (as an example) a program, that has access to hundreds of pictures. I want to apply certain effects to all of them with 'paint.net'. Instead of going through one by one, I would write sth do do that for me. Open --> apply effect --> save --> repeat. GUI is entirely irrelevant.

Does this example make it more clear?

Replies are listed 'Best First'.
Re^3: Executing external programs
by kcott (Bishop) on Feb 19, 2019 at 07:06 UTC

    G'day Silt,

    "Does this example make it more clear?"

    Yes, that helps. I was about to search for a script, that I provided to someone here years ago, that embedded an editor in Tk. I don't need to do that now. :-)

    I don't have MSWin available nor am I familiar with "paint.net"; however, I can tell you how I would do this on my platform using an application that's also available on your platform.

    The application is called ImageMagick. It comes with a commandline tool called convert. I've used this many times, mainly for resizing images or converting images between one format and another; however, as its webpage says:

    "Use the convert program to convert between image formats as well as resize an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more."

    So, perhaps one or more of its features equate to whatever "apply effect" means. If so, download an appropriate "Windows Binary Release" and write your code.

    You've not really provided sufficient information about your application to provide solid help with your code. If it's simply a one-off, quick-and-dirty script, you might get away with something like this:

    my $input_options = ... my $output_options = ... my @files = ... for my $file (@files) { `convert $input_options $file $output_options ${file}.out`; }

    Of course, if this is intended to be production-grade code, you'll want something more substantial.

    I did have a very quick look at paint.net. I couldn't see any indication of a commandline tool but maybe you know of one: if so, you can probably use that with similar program logic.

    — Ken

Re^3: Executing external programs
by haukex (Chancellor) on Feb 19, 2019 at 06:31 UTC
    I want to apply certain effects to all of them with 'paint.net'.

    Image::Magick, Imager, Gimp... or is this just another example? ;-)

    The more specific you are, the better we can help.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1230138]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2019-10-18 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?