We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi guys, I just discovered Processing, and I think it might be exactly what I'm looking for. But I need to check something: can I create a program (or batch file) that I drag an image file onto in order to run some code on that mage?
More details: I want to write some code to read the transparency of pixels and output a text file. As far as I can tell, Processing might be able to do that? Ideally I'd like to finish with a WIndows EXE file, and I just drag an image onto it (or onto a batch file that calls it), and bingo, a text file is created. Does that make sense?
For example, the program "PNGQuant" can creates smaller versions of PNGs: all you do is drag your big PNG onto the appropriate .bat file, and magically a smaller image file is saved. It's super useful. I want to make something similar, but for reading pixels and doing some calculations, then outputting text. Do you think that would be possible in Processing?
Thanks for any comments or suggestions.
Answers
https://forum.Processing.org/two/discussions/tagged?Tag=args[]
Possible
See reference
Loadimage
img.save
Savestrings and the like
use args[]
Many thanks for the prompt replies! I did search for the answer, but obviously my searching skills need help. And thanks for supporting Processing, I've been looking for something like this for years. (But not looking very hard, obviously!)
Yeah, I like it a lot
@tolworthy
You should check the library drop. Install it using the import library available in the Procesing IDE's menu: Sketch >> Import library... >> Add library... and then search for drop. Then in the example section of that library, check the example DropLoadImage.pde. If you can make this as an executable, then you got there almost what you want.
Kf