EasyBatch Tip: Reducing file size of PNG’s

January 4th, 2009

This is something I actually used EasyBatch for myself earlier today. Often times graphic images are saved with lots of ‘extra’ data that we don’t need. For instance, depending on what image editors you use, and what your settings are, some images might be saved with all kinds of extra stuff, like:

  • Author/keyword info
  • A resource fork
  • Extra metadata
  • Preview / file icons

Sometimes we need these things. But often times they amount to bloating. For instance, in BravoBug’s most current software project, I have a large number of PNG’s which are used internally by the app. In this case I need none of the above stuff. I just need the raw image data. And yet when I would save out a .PNG in Photoshop, I found even a 2×2 pixel image was 28 kilobytes in size! Far too large.

Now, I could fiddle with my Photoshop settings, but I already had nearly 100 PNG’s that had been saved. And there’s a much easier way of getting rid of much of this wasted space.

You can use EasyBatch to strip out a great deal of this unwanted data from your files. (Note: if you really want to get serious about reducing file size, you should take a look at PNGCrush).

To strip a folder of .PNG’s of all this bloating, just run an EasyBatch with no modifications. That is:

  1. Select your folder of PNG’s for EasyBatch’s input
  2. Disable everything (resizing, rotation, color changes, etc.)
  3. Select PNG as the output format, and choose a save folder

Now click run. Essentially what EasyBatch will do is just open up the original PNG and re-save a copy. But in the process it will avoid re-writing all of that extra junk that you didn’t need. I found that the 2×2 PNG I saved in Photoshop, which was originally 28k, was now down to a much more reasonable 623 bytes.

One caveat: EasyBatch will re-save with the current monitor color profile settings, so if your color profile must be retained, you shouldn’t use EasyBatch on those files. But otherwise, give it a shot on your PNGs and see how much space you can save!

Happy New Year!

January 1st, 2009

Goodbye 2008, hello 2009!

Happy New Year!

OS X Terminal Tip: Move files to the trash can

December 30th, 2008

Here’s a quick OS X tip for those of you who like to dive into the terminal from time to time. This is an easy way to move all of the files of a particular type (say, a bunch of images on your desktop, perhaps?) into the trash can. This is handy because it’s powerful, easy, and less frightening than using ‘rm’ which instantly (and permanently) deletes the file.

So for demo purposes, let’s say you’ve got 100 files on your desktop, and 20 of those are .zip archives you want to delete (but they could be anything- mp3’s, jpg’s, whatever).

Launch terminal and at the prompt, use the CD command to navigate to your desired location:

cd ~/Desktop

Now you can do a quick check to list all the files of the specific type, using the LS command:

ls *.zip

That command will spit out all the files it sees in your current location which have a ‘.zip’ extension. Again, you can use this for any type of file (*.jpg, *.mp3, *.html, etc.)

Now, for a quick handy-dandy trash of those files, use MV:

mv *.zip ~/.Trash

As you can see, the Trash is actually an invisible directory in your home directory (~). Use the MV command to take all those files you previously listed and drop them into your trash can.

All done!

It’s a big, beautiful world…

December 29th, 2008

And we’re floating on the edge of it!

Unicode Snowman!

December 26th, 2008

http://☃.net

Merry Christmas

December 25th, 2008

Happy Holidays!

IconBurglar v1.1 in the works

December 21st, 2008

On the heels of IconBurglar’s initial product launch, the next upgrade is already being simmered up in XCode, release date to be announced. IconBurglar 1.1 will feature several new interface improvements, the ability to open icons in Icon View mode for any file (not just applications), improved drag’n'drop compatibility, and more!

So please stay tuned. As with all BravoBug upgrades, IconBurglar v1.1 will be completely free for registered users (thank you for your support!)

And if you’ve checked out IconBurglar already and have a feature you’d like to see added, please let us know.

New! IconBurglar v1.0

December 19th, 2008

IconBurglar v1.0 has arrived! Head over to the official software page to check out screenshots and a demo video. IconBurglar is the ultimate icon & resource extraction tool for Mac OS X, which makes it fun, simple, and easy to browse the contents of all your favorite apps (and maybe some apps you didn’t know you had!), and save out their icons and images with ease (just remember to respect any applicable copyrights!).

New! Announcing IconBurglar v1.0

December 18th, 2008

Coming very soon to BravoBug Software is our latest Mac OS X application: IconBurglar. This is expected to hit the front page possibly as early as Friday (in fact, you might even see it pop up on the Shareware store before the page goes live…), so please check back soon to grab your free download!

IconBurglar gives you the power to explore the inner ‘guts’ of your Mac OS X applications in an easy and fun way. Please stay tuned for the official release and more details!

Adding Help to your Cocoa apps

December 18th, 2008

This was a task in Cocoa development that was new to me. In MiLife I provided a customized FAQ document separate from the standard help, and in EasyBatch it opens the web-based FAQ.

In BravoBug’s newest upcoming app I thought it was time I implement a nice Apple-style help-book in the standard Mac OS X way. Surprisingly, getting the help book up and running was a bit trickier than I thought. Apple’s internal help application that is responsible for loading these things is a bit finicky. You have to have several things sync’ed and organized just right. And there are a few gotcha’s, it seems. So here’s a step by step procedure on how to get ‘er done:

1. Create your HTML help file

The actual help files are just HTML pages. So create your pages, and any subfolders of necessary images, stylesheets, etc. I read different tutorials for this, some of which said that your index.html page should be called ‘index.html’, others that said it should be called ‘MyAppHelp.html’ (where MyApp is the name of your Cocoa executable). I ended up using ‘MyAppHelp.html’.

So name your top-level HTML file, “MyAppHelp.html”. The directory that contains your top-level HTML file, should also be called ‘MyApp Help’. Once they’re ready…

2. Add your AppleTitle meta tag

To recognize your help book, you need to add the following meta tag to your top HTML page (in the HEAD tag):

<meta name="AppleTitle" content="MyApp Help">

(Again, replacing “MyApp” with the name of your Cocoa program.) You may also want to add the AppleIcon meta tag while you’re at it.

3. Add the help files to your localized .lproj folder.

Again, I read different tutorials that said different things. Some said the folder did not need to be inside a localized language project. Ultimately what worked for me was having my help folder inside of English.lproj, which makes sense anyways since the only language I speak fluently is English, and that’s what I’m writing in. So move your help folder (and all its subdirectories and HTML files) into the necessary language project for your app.

4. Add the top help directory to your XCode project ‘Resources’

Drag your help folder to your XCode project’s Resources. When the import dialog comes up, be sure to click ‘Create Folder References’. This is essential for preserving the proper folder structure, and was something I kept forgetting to do when I was making my help book.

5. Add two new keys to your Info.plist file.

This should be your top-level Info.plist file (I think). Add the following two keys, replacing the obvious MyApp with the name you have used so far.

<key>CFBundleHelpBookName</key>
<string>MyApp Help</string>
<key>CFBundleHelpBookFolder</key>
<string>MyApp Help</string>

Now you should have a working help book file, when your users select ‘MyApp Help’ from the Help menu, it should load fine. If you choose the menu item and get an error (such as, ‘Help not available for MyApp’), check that you imported your files properly, and that all your files and keys match. If nothing happens, check that the menu item is connected to the First Responder and its action is -showHelp:.

You may also want to run Apple’s Help Indexer app before distributing your app. I believe this provides a meta-data friendly index so that spotlight can find all the goodies in your help file.