PNG Optimizer

No. If the Test macro finds /usr/local/bin/pngquant but it does not find pngquant, then something is wrong with your ENV_PATH variable.

You have a more or less current version of KM, right?

Some things you can try:

  • Restart the KM Engine: KM Editor > File > Quit Engine, then KM Editor > File > Launch Engine
  • Try to copy/paste the exact path from my example above to the ENV_PATH variable

Edit:

If nothing works, can you post a screenshot with the ENV_PATH variable selected in KM Editor > Preferences > Variables?

AHEM, ā€¦ sheepish stupid look on my face.
OH, you mean variable, NOT clipboard? I thought you meant clipboardā€¦ (not really)
ah, yeah, when I set the VARIABLE, ENV_PATH and NOT the clipboardā€¦ a, it worked like it should.
Iā€™ll be crawling under a rock now. =) - LOL.
THANK you for your time, sorry for my mistake.
Have a Blessed day

Yep, I meant ā€˜variableā€™. Forgot to mention it :wink:

Great that it works now!

If you want to use also the advpng options donā€™t forget to install advpng:

brew install advancecomp
2 Likes

Iā€™m tearing up with laughterā€¦ thanx youā€¦ really funny response.
installed advancecomp

all is working beautifully. nice!

Has anyone figured out a way to get optimized PNG output from pasteboard to apps? For example, when I copy a screenshot I've found that ImageOptim generally gets a 15-25% lossless size reduction via the pngcrush+PNGOUT. When these are pasted into apps (such as a chat system) directly they always result in unoptimized uploads, which is highly unfortunate... It would be so nice to have an automated optimized in-pasteboard to yield an optimized png output.

How exactly are you copying/uploading?

A) If you are copying the file path in the Finder and paste it, then the optimized file should get uploaded (as it is on your disk). But what then happens on the chat server, is another thing. For example there might be a server-side script that opens the uploaded PNG, scales or crops it, then re-saves it (unoptimized).

B) If you are opening the PNG on your computer (for example with Preview), then copy the content (āŒ˜A āŒ˜C) and paste it: the unoptimized image data will get uploaded.

I'm sorry @Tom, I thought this was self-evident. I'm talking about copying directly with the image in the pasteboard (shift-control-command-4). So what you're talking about is #B where it's unoptimized image data. What is odd or confusing to me is that when you select different types of image encoding from, for example, Onyx, some apps honor the format (JPG, JP2, PNG, TIF, etc.) when the image is simply pasted in from the clipboard while others do not... This is why it makes me think there must be something else going on where this image can be further optimized and replaced within the pasteboard (clipboard).

The clipboard (after āŒƒā‡§āŒ˜4) contains the ā€œrawā€ image data (tiff) and the data in the format you specified (for example JPEG2000). I think, it is up to the app where you paste in, to decide which format it prefers.

12

Hi @Tom,

I tried your macro. It works great. Thanks for sharing it!

I have one question:
Even when I choose to overwrite the existing files, the new file is not overwriting it. It adds a "-fs8" strong to it's name.
image

Is there a way to remove the "-fs8" string and replace the original image?
Thanks!