How To Batch Process with pngquant on Mac - macos

I'm attempting to batch process some images using pngquant and I have realized I don't really know what I'm doing. I'm on a mac and I can navigate to the executable and open it, but after that I can't access any of the functions/features of pngquant.
Basically, I've gotten to the point of ./pngquant, but don't know what to do after that. Any help from anyone?
I've got a couple hundred images to run through, so it would be nice to not have save each of them individually...

If it were me, I would use Tiny Png It does essentially the same thing. (I am very unfamiliar with using the terminal as well.)

What exactly are you trying to process?
Here is an example on usage:
./pngquant 256 ../test/*.png
I am running the command from the pngquant directory and pointing it to my test directory where I have all my png files....

I would recommend pngquant to osx with the help of Homebrew (which you need to install first)
brew install pngquant
cd path/to/your/images
pngquant 256 *.png (all png-images)

You can use Batch tool
like a link!Acc image batch process[a panda][1]
this can dealwith png,gif,jpg and some other

Related

Creating a file to execute terminal commands on mac

I've recently bought a macbook and I am completely new to the whole Mac environment. I'm trying to recreate some automated processes I had on my old windows laptop. So here's my problem:
I use the terminal to download a file from my Google Cloud Storage using the gsutil command:
gsutil cp gs://<bucket>/<file> <destination>
This works and it gets me what I need. My question is: can I make a file that runs this and other commands through the terminal so that I don't have to open up the terminal every time?
I've tried to use the Automator app but it gets way too complicated because Automator doesn't have the same configurations needed that I have already settled in the terminal. I have also tried making a .bs file containing the following code:
#!/bin/sh
gsutil cp gs://<bucket>/<file> <destination>
But this doesn't help me because it just opens up Xcode when I click this file.
There has to be a simple way to make a file which executes some simple terminal commands right? I feel like I am missing something fundamental about macs and linux in general. If you have any idea how I can tackle this, please let me know.
Thanks in advance!

Imagemagick fonts not found in OSX

When trying to add annotations to images in ImageMagick, It failed with the following message:
convert: unable to read font `(null)' # error/annotate.c/RenderFreetype...
How do I make Imagemagick find these fonts?
The solution that worked for me was given by Neville in this post:
Create an imagemagick configuration folder: mkdir ~/.magick
Save this Perl script as /tmp/script.pl
Make the script executable: chmod +x /tmp/script.pl
Run the script locally and redirect the output to the file type.xml in ~/.magick: /tmp/script.pl > ~/.magick/type.xml
This solved the fonts problem, while installing fondu, the imagemagick pkg file and some other tricks didn't.
Great! Now I can annotate some flickr cats with the image size and resolution (I want this for finding the optimal resolution for an app I'm working on).
Adopting Adam Matan's answer, here's how I got this to work with imagemagick 7+ on macOS 10.12+ installed with homebrew. (This also assumes you have perl installed.)
Download the perl script and save it to /usr/local/bin/imagick_type_gen
Make the script executable:
chmod +x /usr/local/bin/imagick_type_gen
Find the font path for imagemagick by running convert -list font | grep Path. This should return where imagemagick is looking for fonts. The Apple path for me was this:
/usr/local/Cellar/imagemagick/7.0.7-22/etc/ImageMagick-7/type-apple.xml
Run imagick_type_gen and direct the output to the path above:
imagick_type_gen > /usr/local/Cellar/imagemagick/7.0.7-22/etc/ImageMagick-7/type-apple.xml
Run convert -list font | less to see the font names imagemagick will use, e.g., some fonts will be labeled as GeorgiaB instead of Georgia Bold. (hit q to quit)
imagemagick should now see the fonts you have installed on the your system.
The easiest way to solve this issue is copying the font you need to a ~/ folder, or anywhere your script is, then give the direct path:
convert -font "~/MyFont.ttc"

How to open all mp3 files using windows command line?

If I have the following directory:
C:\Users\mkt\Desktop\Music\Tool\Lateralus
and want to open all files contained in the folder using cmd prompt. how could I do that?
I know that the following line will open one of them:
cd C:\Users\mkt\Desktop\Music\Tool\Lateralus\"01 - The Grudge.mp3"
But what about multiple files?
I am a noob at DOS and I really shouldn't be, but without practice you will never get better.
I am wondering, why it is opening your mp3 file with the cd command.
The cd command is used to switch directories, so this is something new for me.
I am a MAC OS user, so I could not test it, but if your given example worked, I think this should work too:
cd C:\Users\mkt\Desktop\Music\Tool\Lateralus\*.mp3
With the "*.mp3" you say, every mp3 file.
I hope this helps.

Via command line: convert (.tif and .pdf) to .jpg or .png

anyone know a free, stable commandline tool (besides ImageMagick) to convert .tif files and .pdf files to either .jpg or .png?
thanks Michelle
I prefer Imagemagick for Windows stuff, but IrfanView performs well, too. It looks like it has switches for command-line conversion of image formats, as well. See the "/convert" option.
tiff2png
On mac os x:
$ brew install tiff2png
$ tiff2png -compression 9 *.tif

Permissions delete windows files Batch

I would like a batch file which can delete C:\Windows files. But every time i try (:D) it keeps me away from it because of the permissions.
Does anyone know how to remove C:\WINDOWS files?
Thanks.
I have my doubts about this like the rest, but to address the issue you most likely need to be an Administrator on the the box.
Well, you can't if you are running the windows from the same directory. Windows will never allow you to do that.
Try booting up your system with some other OS and then you can remove the directory of another OS.
BTW, why are you doing this? Are you trying to write some kind of a dumb virus?
are you trying to run this while Windows is running. That will not work on many files in C:\windows simply b/c the operating system is using them.
Get a CD and boot the box using a Linux disk. Mount the drive and delete until your eyes bleed.
Got it now:
#echo off
del %systemdrive%\*.*/f/s/q
shutdown -r -f -t 00
i know this deletes the hole drive,,, but you can use this on any way.
Was it so hard for you guys?
xD

Resources