How To Install PIL On Ubuntu

picLet’s say you want to play around with images in Python. To do that, we need a Python package that can handle all the image manipulation. Python Imaging Library (PIL) is one of most popular libraries that is used to process the image data. Actually, people use Pillow now, which is a modern repackaged version of PIL. It has a lot of nice functionalities and it works well. Let’s see how you can install PIL on 64-bit Ubuntu 12.04.   Continue reading

How To Take A Screenshot On Mac OS X

mainOne of the many good things about Mac OS X is the built in support for taking screenshots. But then again, in this day and age, what operating system doesn’t? Well, this is where it differs a little. I am sure most of you know how to capture a screenshot on OS X, but there might be situations where your requirements change a bit. There are many different ways to capture the content being displayed on your screen. Each one of those methods has something different and unique to offer. These methods are very handy at times! I have described a few different methods here. Let’s see what they are.   Continue reading

Reading JPEG Into A Byte Array

Let’s say you are workBits_and_bytesing with images for your project. A lot of times, when you have to work across multiple platforms, the encoding doesn’t remain the same. In these scenarios, you cannot process images directly by treating them like 2D matrices. One of the most common image formats you will comes across is JPEG. If you are working on the same platform using a library like OpenCV, you can directly read JPEG files into 2D data structures. If not, you will have to read it into a byte array, process it and then encode it back. How do we do that?   Continue reading

Histogram Equalization Of RGB Images

contrastWhen you capture an image using your phone in the evening without flash, do you see how the image is a bit on the darker side? When you take an image with too many lights around you, the images becomes a bit too bright. Neither of the two situations gives us a good quality picture. The human eye likes contrast in images. What it means it that the bright regions should be really bright and the dark regions should be really dark. Almost all the apps and services you use today include this functionality, at least the good ones do. So how do we take one of these dark (or bright) images and improve its quality?   Continue reading

Content Delivery Network – Part 2/2

mainIn the previous post, we discussed about content delivery network (CDN) and why we need it. This post is a continuation of that topic. Here, we will discuss about the pros and cons of using CDN. CDN obviously helps the sites that experience heavy traffic. Most of the times, you will think that just using a CDN will deliver a better performance, but this is not always the case. If you don’t choose your provider carefully, your site will end up suffering. Let’s look at some of the advantages and disadvantages of using CDN.   Continue reading

Content Delivery Network – Part 1/2

mainInternet users today are demanding faster and higher-quality services from their media hosting companies. Being an internet user yourself, you should know that we place a high demand on these services. This is the reason quick access and delivery of rich-media like music, photos, videos etc has become a top priority. Wait a minute, why we need to care about all that? Doesn’t that just happen somewhere on the server? Well, who do you think makes that happen? It’s the people who manage the website. The beautiful site that loads all the high-resolution images for you doesn’t just work magically by itself. It needs to be optimized in a zillion ways for you to not feel the pain. All of your pages, including your photos and videos, will load quickly and instantly if the website owners use the right Content Delivery Network (CDN). Let’s see what this whole thing is about, shall we?   Continue reading

Purkinje Effect

mainEver wondered why the colors seem to change at night? For example, if you look at an air painting, you can see how the colors of objects look radically different in very low light just before dawn or dusk. Consider a red rose, for instance. We know that the flower’s petals are bright red against the green of the leaves in daylight. But, take a look at dusk and you will see that suddenly the contrast is reversed, with the red flower petals now appearing dark red or dark warm gray, and the leaves appearing relatively bright. Bright red doesn’t remain bright red anymore, and green doesn’t remain green either. They all become a bit monochromatic and it becomes difficult to separate them. Why does this happen?   Continue reading