I've been playing around with pngquant to optimize some pngs. It uses this syntax:

   usage:  pngquant [options] [ncolors] [pngfile [pngfile ...]]

I'm able to use it both in Terminal and with LiveCode's shell command. I pass it some options and a file name, and it makes a new optimized png file in the same folder.

Now I want to do it via stdin/stdout. I want to pass it a file name on disk (or an image in a stack) and get back the binary data for the new image. The man page says this:

"The output filename is the same as the input name except that
it ends in "-fs8.png", "-or8.png" or your custom extension (unless the
input is stdin, in which case the quantized image will go to stdout)."

How would I use stdin/stdout? I tried passing it the binary data of an image in a stack but I get back "command not found." If I pass it a file path on disk it always writes a new file.

Here's an example of a file-based command that works:

   put <pathToPngquant> && "16" && <pathToImage> into tCmd
   get shell(tCmd)

The "it" variable is empty, and the new file appears on disk. I want to do this:

   put <pathToPngquant> && "16" && (the text of img 1) into tCmd
   get shell(tCmd) -- get binary data back

Or, if not the text of img 1, using the binary data of an image on disk would be okay too.

--
Jacqueline Landman Gay         |     [email protected]
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to