Compression

Zen Digest:

  • Basic breakdown of different types of compression

The Whole Picture:

If you’ve ever worked with images (either by sending digital photos, or building anything with a graphical component) you’ve probably encountered some of the major image file formats such as GIF, JPEG (jpg) or PNG.  Those are some of the most common ones, but there are probably a few dozen different image file formats.  They are all a little different and what differentiates them is compression and quality.

A digital image is essentially a list of colors.  Each color maps to a pixel, and when those pixels are put next to each other, they comprise the image you see.  Since today’s cameras (even on your smartphone) take pictures in megapixels (the latest iPhone takes pictures that contain 8.7 million pixels).  If you wanted a rich set of colors, such as 16-bit color (about 32,000 unique shades), you’d end up with a 16 megabyte image for every picture.  That would be unnecessarily huge.

(If you want to know which image file format is best to use, check this out)

Now we get to compression.  So much data is redundant.  For example, instead of the full 32,000 colors, you could limit the amount of color choices and greatly reduce the file size.  This is obvious – less options, less size.

Then, we get a little more thrifty.  Since frequently, two pixels that are next to each other may be the same color (or very very similar) you could simply combine them into one pixel.  Now, if you had 3 or 4 in a row, you could just say “repeat this color 4 times” and use 30% of the space that repeating the color 4 times would use.  If your image frequently re-uses the same color, this could lower the file size from 16 megabytes down to 3 or 4.  At this point, this is where “lossy” and “lossless” compression come in.  Lossless would require that the two pixels be exactly the same color (hence no actual information was lost).  Lossy would say “as long as the colors are close.”  Most of the internet uses lossy compression for images.  It is much more efficient at reducing file size, yet it produces a bit of a blurring effect.

The last way to compress an image is to create an index.  For this method, a program analyzes the image and comes up with a set number of colors – usually 8, 16, or 64 (although any multiple of 2 is possible).  It scans the image and assigns every pixel to be the closest match to the 256 colors it chose.  This allows the image to remain fairly crisp, but reduces the color range greatly.

The final isn’t really compression, but it’s about reducing file size.  Often a 10+ megapixel image is simply gigantic (3000+px by 2000+px).  This is extremely large and more than what most monitors and screens can even display, so what you see is the image shrunk down.  By simply reducing the file size (although always try to do it by a factor of 4), you can reduce the file size greatly without losing much quality (although you lose the ability to zoom in with high quality).

Share

Reduce Unnecessary Dependencies

Zen Digest

  • Limit what you absolutely need
  • Know your alternatives
  • Recognize when dependency could lead to catastrophe

The Whole Picture

No man (or woman) is an island.  We depend on others and their expertise to make our lives easier.  This is the reason we have skyscrapers, the internet, and cheesecake.  But, it’s important to understand when you are being helped by someone and when you are dependent.

For those who are unfamiliar with computer programming, a good analogy would be to equate it to building something with Lego.  All the pieces are there, and you really only have a limited number of pieces, but the way you put them together makes a castle, a space ship, a monorail, or a jungle hut.  Coding is the similar.

When programming, you also rely very heavily on external services and code written by other people.  For web developers, there are Javascript frameworks like jQuery, Backbone, and Underscore (to name a few), and for HTML/CSS developers there is Bootstrap.  There are also plenty of hosting solutions that will store and run your code for you.  The value these services and frameworks offer is immense.  jQuery took hundreds of developers contributing over many years to get it to the state it is in today.  Developers are still working on it.

But all of these frameworks and services have pros and cons.  To be as useful as possible, these frameworks include a large amount of code that takes up space (and sometimes processing time) that your application may never use.

In code, and in life, I’ve found myself relying very heavily on certain services, and code.  Some riskier than others.  For example, if the jQuery foundation were to close up shop tomorrow, I’d still be able to use the code on my sites now, and it would remain relevant without updates for a few years to come.  But, there are certain retailers I purchase from, and service providers that I depend greatly on and spend quite a bit of money.  Are these businesses good in the long run?  In my quest to save a few dollars, am I potentially taking a job away from a neighbor?  Or, if Gmail decided to start charging for personal email (they won’t) would I have a plan to find another email service?

I recently switched from having an iPhone and a Mac (I still have a Macbook Air for my laptop), to having an Android phone and a Windows-based desktop.  The biggest change was that things were less integrated.  At first, it seemed a bad thing – an annoyance.  But, after I found a few pieces of software to address most of these issues, I actually realized it was a wonderful thing.  By separating out services, I now reduce the risk of catastrophic failure.  It’s the difference between pouring 10 glasses of water, and spilling one, or spilling the entire pitcher.

 

 

 

Share

500 Year Plan

Zen Digest

  • For everything you make, think about it’s affect on the future
  • The future will outlive you

The Whole Picture

Back in business school, I learned about W. Edwards Deming.  Back in the 1950s, he tried to woo US businesses with his strategy of Plan-Do-Study-Act (which is the basis of Six-Sigma for anyone who’s involved in project management).  American businesses – flush with great success following World War II didn’t take well to his ideas.  But, Japan, having been devastated by the war welcomed him as one of their own.  He revolutionized the Japanese industrial complex and is often credited with helping to make them the superpower they are today.  One of the things he learned while there and brought to his teachings was the concept of a 500 year business plan.

There are companies in Japan that are over 1000 years old.  Deming was fascinated by this and determined that it was very common for Japanese businesses to have a 500 year plan.  Something insane for an American business to determine when America was barely 300 years old.  While there was always a focus on both today and tomorrow, with a look into the deep future, these businesses were playing a strategic game of chess while others were playing checkers.

Science says we won’t live too much past 100.  Chances are, only a small percent of us living today will break the 100 mark (although, science often proves it’s prior self terribly wrong, and could create immortality, but for today, we’ll assume 100 is a reasonable cap).  So why have a 500 year plan?  The reason is – our children, our neighbors children, and our community will survive 500 years – if we make it part of our plan.

Technology is about creating and destroying.  Hopefully you’re destroying the things that are bad and unnecessary, while creating things that are good and create positive value.  But we always need to ask ourselves – what is the 500 year impact of my choice, and what are my 500 year goals.

Imagine a large coffee shop chain that was making a decision to overhaul the cups they give out with their beverages.  They could choose the cheap plastic non-recyclable cups, the slightly more expensive paper recyclable cups, or to ask all customers to use reusable cups (even more expensive).  If you are looking for quarterly results – the cheap cups will boost your profits.  But, when you look at the 1 year costs, the increased garbage, land use, and environmental impact of the cup creation, things start to add up.  Look out 5 years, and things are pretty messy.  20 years and it becomes a non-option.  Even looking at the recyclable cups, you realize that there is environmental impact from shipping the cups (which may take 5-20 years before the cost becomes a real factor).

The same goes with technology.  Do you upgrade your phone every year?  What do you think happens to your old phone?  Is your new phone environmentally friendly (let me answer that for you – no, it’s not.  If you have an iPhone, you should probably plant a few trees to offset the negative effects of it’s creation/disposal.  If you have a different smart phone, you should probably still plant a few trees, but maybe a tad less).

Every decision we make – from the cars we drive, the devices we use, to the software we write – will have an impact on the world around us.  Often it’s a mixture of positive and negative.  But, we should always ask – what is our 500 year goal, and will our actions today make that goal possible.

Share

Upcoming Book!

Zen Digest

  • I have a mini-guide (ebook) coming out soon
  • It’s “Stress Free Email”
  • Will be free for subscribers of this list (donations welcomed)
  • Price will be $4.99 – First week special of $1.99 – please help spread the word

The Whole Picture

One of my personal goals is to publish.  I work in the publishing industry, and I feel the best way to learn is to dive right in and experience it as both an insider and a cog in the machine.  My goal is to engage in different methods of publishing – self publishing, traditional publishing (were I get backed by a publisher) and non-traditional publishing (such as using this mailing list).  I’ve also created a small publisher named “Zen of Technology Institute” which will cover all Zen of Tech books I self-publish as well as other books of friends and family (do you have something that would be good to publish under Zen of Tech Institute?  Let me know!)

The difference between writing a book or mini-guide as opposed to writing for the mailing list is that concepts need to be coherent and the story needs to flow.  I wouldn’t dare just organize these emails into a book, slap a cover on it, and expect anyone to buy it.  Not that the content isn’t good, it’s that it lacks a story, it lacks glue holding it together.

Each mini-guide I produce will cover a single topic and tie things together.  Beyond the information I’ve provided here, I’ll provide additional context, and put forth information in a way that is more memorable and more enjoyable to read.  The guides – with few exceptions will be shore.  The first guide will come out July 15th and is “Stress Free Email.”  I will be providing it free to subscribers.  I will send you all a special link to download the ebook which will be active for 1 day.  Others will have to pay $4.99.  As an additional promotion, I’ll be offering it for $1.99 for the first week.  It will be available on every platform and DRM free.

If you have any requests for topics, please let me know!

Thank you for reading.

 

Share

Sex, Religion, and Politics

This is not a post about technology – but a post about humanity, doing what’s right, and making the world a better place.

I was taught – as I’m sure many others were – not to talk about sex (gender, or the act of love making), religion, or politics.  They are supposed to be taboos.  The reality is – if we don’t talk about those things, we are doomed to let those in power make decisions for us.  Just yesterday, the SCOTUS (Supreme Court of The United States) made a ruling that businesses can decide not to pay for contraceptives for women.  There has been much buzz and talk about this, so I hope to address a more wider issue (but it was this specific ruling that lead me to write this.)

Many of the people I look up to in life and in business are women.  Many of them have been open with me about the atrocities that women place in the workforce and on the streets.  I’ve always wanted to help, and while I believe I treat women equally in business and personal life, I don’t think that’s enough.  I’ve tried to engage in conversations – yet humorously enough, was told I was “mansplaining” things.  I guess a white male could never offer advice or perspective – or could I.

What not many people know about me is that I have a deep passion for business, ethics, politics, and social order.  Part of the reason I took such an interest in Taoism and Zen was my interest in learning about different cultures and religions when I was younger.  What’s great about history is that we can look back on it objectively.  We can dig into the ruling class – because none are still in power to reciprocate – and we can pity the unrepresented because we can distance ourselves from them.

The best means of control was education.  Keep people in the dark, and show them your light.  It’s much easier to accept the food that’s being spoon fed to you than to learn how to grow your own food – especially when there are others who may stomp on your crops for doing so.  Education is the key to freedom and equality.  Look how well it has done to advance society.  We have the internet, cell phones, irrigation systems, indoor plumbing, and netflix!  Truly we are a society of great achievements, but there are scientific gains based off scientific education – we still lack the ethical and moral education.

Education comes from freely, calmly, and openly engaging in conversation.  Science discoveries aren’t made from scientists screaming back and forth about the right way to do things, they happen when scientists work together and come up with hypothesis and test them over and over.  In science we can be proved wrong, change our knowledge and that is seen as a good thing – but why is a change in moral compass bad?  We chastise a political candidate for agreeing with something one day then disagreeing the next.  If there is sound logic for his or her change, we should celebrate that.

For a long time, I’ve wondered what I can do to help promote equality.  Every politician who’s mailing list I’m on tells me that I can help them by donating $5 or more.  But, I’d rather put my money where my mouth is.  Supporting a candidate or cause with money is fine (and scientific causes that need research money need your money more than your mouth :)), but social causes need your words.  Open up a dialog with your friends and your family.  Discuss politics.  Discuss gender equality.  Discuss religion.  Remember that a discussion is two ways.  Starting out by telling a person how they feel is wrong is not the right way to start a discussion.

Ask them their opinion, and why they feel that way.  Personalize things and ask if they have ever been discriminated or have discriminated others.  Talk about their views on local and global politics.  What’s their feelings on guns?  War overseas?  Immigration?  Some of these conversations may not be easy, but they are important.  Many beliefs are imbued on to us – a person of authority (religious figure, parent, mentor) told us we needed to feel a certain way or think a certain thing, therefore we do.  Until we actively question it in ourselves, we cannot possibly change our view.

Education takes time, patience, and persistence, but it is worth it.  Imagine a world where science stopped learning in the 1900s.  We’d be dealing with a serious horse manure problem, that’s for sure.  The reality is, we learn from our friends and our loved ones as well as people in authority.  But, if the only ones speaking are those in authority, we are letting the voices of few control the minds of the masses.  Only when we learn to approach those taboo subjects and have open dialogue can we hope to create a more educated and respectful populous.

Thank you.

Share