Barnack Posted April 29, 2019 Share Posted April 29, 2019 (edited) 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 April 29, 2019 by Barnack Quote Link to comment Share on other sites More sharing options...
Reptillian Posted April 29, 2019 Share Posted April 29, 2019 (edited) 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. Edited April 29, 2019 by Reptillian Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Barnack Posted April 29, 2019 Author Share Posted April 29, 2019 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? Quote Link to comment Share on other sites More sharing options...
Reptillian Posted April 29, 2019 Share Posted April 29, 2019 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. Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Barnack Posted April 30, 2019 Author Share Posted April 30, 2019 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 Quote Link to comment Share on other sites More sharing options...
BoltBait Posted April 30, 2019 Share Posted April 30, 2019 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. Quote Click to play: Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game Link to comment Share on other sites More sharing options...
Barnack Posted April 30, 2019 Author Share Posted April 30, 2019 (edited) 4 minutes ago, BoltBait said: For someone who's never seen the source code, you seem rather sure of yourself. 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 April 30, 2019 by Barnack Quote Link to comment Share on other sites More sharing options...
Rick Brewster Posted May 1, 2019 Share Posted May 1, 2019 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. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.