Jump to content

Suggestion: Command line options and tools


Recommended Posts

Would it be possible to allow for command line usage of paint.net?  It would let people automatize some kind of works through .bat scripts.

An idea would be taking actions in order as arguments.
The program called with files would still open it with said files, using command line tools would become more like a script, with actions as they appear in the menus.

 

  • paint.net -cl < means paint.net will receive actions through command line with no need to open any window.
  • open([file]) < list of files (or special characters) to be opened and apply all next actions to all opened files. It is required to have any file to perform actions on.
  • open(*.jpg) < opens all jpg in current directory
  • adjustments/black_and_white() < turns all images in black/white
  • image/canvas_size(50%, top_left) < changes canvas size percentage
  • image/canvas_size(50px, 60px, 30px/cm, top_right) < change canvas size by pixels with given resolution. If resolution is unspecified it will not be changed.
  • image/canvas_size(30px/in, 10in, 5in, left) < change canvas size by in or cm with given resolution. If resolution is unspecified it will not be changed.
  • help() < show help for specified command
  • help(image) < shows list of options under image dropdown
  • help(image/canvas_size) < shows the 3 possible sets of arguments i wrote before
  • save_as([file]) < saves the file.

 

If save_as is not specified, all opened files will be overwritten with the modifications applied.

 

EXAMPLES:
converting all jpg to png in a folder

paint.net -cl open(*.jpg) save_as(*.png)

 

turning all jpg files to brighter ones with 30*30px size

paint.net -cl open(*.jpg)  adjustments/brightness_contrast(65, 0) image/resize(best_quality, 30px, 30px)

 

The syntax is just from my personal taste, anything else would do as long as it works and is readable

 

Another option would be embedding a lua interpreter (although i HATE lua but nevermind) and make all the functions that are called through gui buttons available in script. It would take next to no time to add this to the gui mode (just script > call script, chose a .lua file, run it), and i think it wouldn't take long to add it as a command line argument either

paint.net -script "myscript.lua"

 

 

 

Edited by Barnack
Link to comment
Share on other sites

1 hour ago, Reptillian said:

I have never heard of this thing. But, there exists G'MIC, which can do all of that. As a PDN plugin or CLI tool.  You could use GIMP or Krita and use the G'MIC filter. ImageMagick would work too.

it's a feature suggestion, maybe it wasn't that clear😅

Wrong section for suggestions?

 

Link to comment
Share on other sites

1 hour ago, Barnack said:

it's a feature suggestion, maybe it wasn't that clear😅

Wrong section for suggestions?

 

 

I'm not sure it'll happen, for that you would have to ask @Rick Brewster , and I get the impression that it won't. I do have a solution if you want to use Paint.NET and not a established solution that's accessible to most people like G'MIC or ImageMagick - AutoIt v3. If you don't like AutoIt v3, you are stuck with a pdn plugin which only batch process effect on one layer which is Effect Labs by pyrochild or G'MIC or ImageMagick which can support imports and outputs along with multiple layer internally.

 

G'MIC Filter Developer

Link to comment
Share on other sites

18 hours ago, Reptillian said:

 

I'm not sure it'll happen, for that you would have to ask @Rick Brewster , and I get the impression that it won't. I do have a solution if you want to use Paint.NET and not a established solution that's accessible to most people like G'MIC or ImageMagick - AutoIt v3. If you don't like AutoIt v3, you are stuck with a pdn plugin which only batch process effect on one layer which is Effect Labs by pyrochild or G'MIC or ImageMagick which can support imports and outputs along with multiple layer internally.

 

Honestly it's so easy to add these things with a lua interpreter that i'd do it myself if pdn was open source 

Link to comment
Share on other sites

15 minutes ago, Barnack said:

Honestly it's so easy to add these things with a lua interpreter that i'd do it myself if pdn was open source 

 

For someone who's never seen the source code, you seem rather sure of yourself. :D 

 

 

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

4 minutes ago, BoltBait said:

 

For someone who's never seen the source code, you seem rather sure of yourself. :D 

 

 

well i'm someone that hand wrote an interpreter for a subset of the C language as an hobby for a personal project until last week; and before writing that i considered using lua and read the documentation.

Adding a lua interpreter to anything is easy, regardless of what it is. And as long as each effect from the gui ends up calling a function (which it should), then it's easily done.

 

(although i hate lua's syntax, which is why i wrote a c-like interpreter… yep i'm crazy) 😂 

Edited by Barnack
Link to comment
Share on other sites

It's actually not the choice of scripting technology that's the issue; it's the matter of making PDN's internals so they're palatable for that scripting system and the people using it. It's just a large project that isn't at the front of the queue.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...