They say you learn something new every day.

I’ve been reading Scott Hanselman‘s blog recently. I found it through Jeff Atwood’s Coding Horror Blog. It was one of those things I found ages ago and then forgot about. My bookmarks list is a bit of a jungle these days, and probably needs some work done on it.

I was reading a post today about png files and I remembered that png files are lossless and jpgs are lossy. D’oh!

PNGs are lossless, dummy

It’s one of those things that makes you feel silly when you remember and realise you’ve been doing it wrong. That’s why a while back I switched from jpgs to pngs on my website. Double d’oh. This is the worst; I used to do it right and now I’ve started doing it wrong. I’m getting stupider.

But, hey, this is what my whole “learn something new every day thing” is about. As long as I’m less stupid than I was yesterday, it’s okay.

So, today, I scanned a couple of images straight to png. I also noticed that Scott points out there’s a way of optimizing png files using a piece of software called PNGOut (actually, tracing the article back, it looks like he got it from Jeff).

Interestingly, when I first clicked on the page they linked to, I ended up thinking I needed to pay for it. They also linked to this GUI version, which you don’t have to pay for. So I picked the GUI version.

The GUI version requires the latest version of .Net. In my quest to keep my computer lean and uncluttered, I often end up going around the houses like this when I install new software.

Interestingly, there’s a link to a page (again, by Scott) that shows you how to get the smallest version of .net possible. None of these bloated, 100MB plus downloads. Horray!

Having done all this, I installed PNGGauntlet and had a play. I ran it on a 14MB png file to see the difference. It took ages to run, but it did lose about a meg with no noticeable loss in quality.

Png Gauntlet Doing it's thing

Feeling all smug, I sat down to write this article. However, as I was researching the links, I discovered there is a command line version of it. Which is what I was looking for in the first place.

I’ve started to like using command line applications now:

  1. You can batch script it to do lots at once
  2. It’s good practice in scripting
  3. They’re ultra-simple and you don’t need to install them or anything like that

So, I grabbed that, and the syntax is really easy:

pngout inputfile.png outputfile.png

The other thing I’ve learnt here is that writing out instructions or teaching something to someone else, really does help you learn it yourself.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Tag Cloud

%d bloggers like this: