Posts Tagged ‘PNG’

Which bitmap format to choose

Hi folks,

Following the short suite of articles that briefly described the most popular raster graphics file formats, today we will try to make a synthesis and see which format would be a best choice for which purpose.

Image capturing
When capturing images, either by scanning a document or taking a photo, the best idea would probably be to get the highest quality possible and keep the full amount of details.
The initial capture file is a “master” file so, unless you can repeat the same capture process anytime or don’t care about long term preservation, you can store it somewhere safe and convert it to other formats for current manipulation.
And if you think that such practice is for professionals only, you’d better think again.
IT evolves at highest speed: image acquiring quality is increasing, bandwidths are getting larger and cheaper, storage spaces too and image quality standards are adapting accordingly so what was considered a professional level of quality few years ago, today is widely common.
So you shouldn’t be afraid to use TIFF format as best choice for richest captures.
But there’s always PNG at disposal too of course.

Image handling
Chosing a format for image handling depends mainly on the kind of image involved but also on its manipulation purpose.
For example, JPEG is notoriously the best choice for photos offering an optimum quality vs. size ratio, we’ve explained you previously how this was achieved.
JPEG can be used especially for smooth-toned images but due to its small sizes, even if quality-lossy, it can be used for any kind of images including documents.
Actually, when it comes to documents to be shared at real minimal size with least acceptable quality, there is JBIG2.
Making a visual comparison between a JPEG and a JBIG2 format version of a same document might seem to turn JPEG into a winner.
But for large amounts of documents or for transfering documents through busy networks, JBIG2 is a life-saviour.
In case the quality of the document is really important, PNG should do the trick.
For web graphics, GIF and PNG are largely prefered.
They both are palette-based and the file-sizes depend on bit depth and on the number of colors of the palette, one basic difference being that GIF allows animations while PNG supports gradual transparency.
So they both are well-suited for webdesign items like logos, buttons, banners and so forth, the choice depending on graphic artist’s intentions.
For short animations (today used mostly for tutorial/explanatory purposes) GIF is the only choice, similar to how PNG is the only choice for graphics where variable transparency is required.
As you’ve probably noticed, we’ve mentioned PNG several times above as it can be used for full-colour images with lossless compression, continuous-tone full-colour images at the highest quality (not highest compression), B/W and greyscale images, for desktop and web purposes, thus making PNG a reliable and versatile quick choice solution when there is no real pressure for a certain requirement.

Image printing
Normal printers are designed to work fairly well with all kind of image file formats.
But if printing quality is a serious requirement (talking about desktop printing quality level, not highly professional level) then the “give me most possible data from uncompressed source and I’ll give you best possible result” principle applies.
In other words: use TIFF.
Which is yet another reason for you to consider the initial recommendation above of keeping “master” files.

Well, the circle being closed now, let’s just add that we’ve tried to keep everything as basic as possible.
There are many aspects and details we’ve intentionally skipped because the scope of our blog articles is simplicity.
But if complexity is what you need, please feel free to use GdPicture.NET SDK to build applications controling every possible detail of images in more than 90 supported file formats.
And if you’re not into software development, have no worries: we’ve already built such application for you.
It is called PaperScan and it can be downloaded from here.

See you next week, folks!


Big Browser on August 23

Some iRumours Read article Average Income per Programming Language Read article The Story of the PING Program Read article Meet the NASA scientist devising a starship warp drive Read article Google can't have dotless domains, rules ICANN regulator Read article

Briefly about PNG

Hi folks!

As promised last time, today we are going to give you a very quick overview on PNG format.

In a previous article we’ve told you that  PNG format resulted from the effort of making a better and royalty-free successor for GIF, which at that time was confronted with a patent issue due to the LZW compression.
After the LZW patent expired, GIF got back to “freedom” but PNG was already there as the world’s most used lossless compression raster image format for WWW sharing, standing as a living example of how great things people can achieve when outrage unifies them against what they consider to be unfair.
As Wikipedia’s dedicated article puts it, “the original PNG specification was authored by an ad-hoc group of computer graphics experts and enthusiasts. Discussions and decisions about the format were done exclusively via email.”

But that’s about all when it comes to poetic aspects in the history of  PNG; all the rest is a remarkable lesson of practical efficiency.
The first  PNG draft was issued on 04 January 1995 and within just one week,  most of the major PNG  features were proposed if not even already accepted.
In the upcoming 3 weeks, 7 important drafts were produced.
Such amazing efficiency is explained by the above cited source as being the result of the high level of expertise of the team members combined with the “benevolent dictatorship” role assumed by Thomas Boutell.
Looks like this collaboration model (a small team of skilled members led by a respected and even beloved “dictator” , having an undisputed final word whenever consensus isn’t reached) worked very well for Linux kernel development , too (in that case the “dictator” being Linus Torvalds, of course), which is quite an interesting detail to mention as our own team works exactly the same way.
But back to PNG, by the begining of March 1995 (just 2 months after creation of the very first draft!) all specifications were in place (as of draft # 9)  and they were so good they were officialy frozen.
In October 1996 version 1 of the PNG specifications was publicly released, at the same time becoming a W3C recomendation.

In short, the PNG format, (Portable Network Graphics, file extension .png) is a network-friendly, patent-free lossless raster graphics file format supporting grayscale images (with or without alpha channel) as well as both palette-based images (with palettes of 24-bit RGB or 32-bit RGBA colors) and full-color non-palette-based RGBA images (with or without alpha channel).
It also notoriously provides a transparency channel, allowing the colors in the image to fade from opaque to transparent.
And as its primary purpose was quality-image sharing over the internet, PNG optionally allows 2D interlacing , we’ve told you about that in our previous articles on JPEG and GIF formats.

But let’s add just 2 quick side-notes.
First, PNG not being meant for professional-quality printing purposes, it doesn’t support CMYK  or other non-RGB color spaces .
The other one is about animations support : as a “successor” to GIF, PNG provides animation feature but not within the PNG format itself.
Instead, a variant (or extension) of PNG exists, named MNG (“Multiple-image Network Graphics”), which was still designed by the PNG Group, but it never reached popularity.

All that being said, PNG is an universal (cross-platform and cross-browser) format with a well-deserved place among digital image formats standards.

Of course, all our products, such as GdPicture.NET SDK toolkits for developers or PaperScan for the general public, fully supports PNG as well as its conversion to- and from-  some other 90 image file formats.

In our next article we are going to make a synthesis to find out -by weighing the pros and cons- which image format would be a best fit for which purpose.

So see you next week!


Big Browser on August 9

The Most Anticipated Gadgets Of The Year Read article Ethernet Turns 40 Read article Google Chromecast Review - An Awesome $35 HDMI Dongle Read article Why YouTube buffers: The secret deals that make—and break—online video Read article First thoughts on Firefox OS Read article

LZW and 3 graphics file formats

Hi folks,

This week we are going to tell you a short story about LZW compression and how it influenced 3 widespread graphics file formats: TIFF, GIF and PNG.

The story begins in 1977 and 1978 when israeli computer scientists Abraham Lempel and Jacob Ziv published descriptions of lossless data compression algorithms named LZ-77 and LZ-78, respectively.
Terry Welch, an MIT trained computer scientist, further developed the LZ algorithms and, in 1984, he published the Lempel-Ziv-Welch (LZW) algorithm.

LZW compression became the first widely used universal data compression method on computers.
Being so influential, the “LZ-” based various algorithms became, of course, subject to patent protection in many countries.
For LZW, two patents were issued in the USA (but in other countries as well), the one filed by Welch himself being assigned to Sperry Corporation (Welch’s employer) in 1983.
Sperry Corporation became Unisys in 1986.

Just to have a glimpse on the algorithm, consider this string: “The cat chases the mouse in the room”
The word “the” occurs 3 times.
Replace it by “!” and the string becomes: “! cat chases ! mouse in ! room”.
Add this association (“the” to “!”) to an index and you’ve reduced the length of the string from 36 to 30 characters.
Of course, things are way more complicated than this but the main idea is that the algorithm works very well when there are many repetitive data.
And image files usually contain lots of repetitive data.

In 1986, Aldus Corporation released the first official TIFF specification and in 1988 revision 5.0 was released, which included the ability to use LZW compression.
In 1987, CompuServe created the GIF file format, the GIF specification requiring the use of the LZW algorithm to compress the data stored in each GIF file.

The holder of Welch’s LZW patent, Unisys (which maintains a portfolio of about 1500 patents), was motivated to monetize this patent as much as possible and it had to be fast, too, as the patent availability was 20 years.
Overall, the total number of licensees was about 100, among which Adobe was licensed in 1990 for the use of LZW patent for PostScript and Aldus was licensed in 1991 for the use of the Unisys LZW patent in TIFF.
Licensed LZW in TIFF generated a wave of discontent so Aldus quickly introduced JPEG compression in TIFF (as of revision 6.0 in June 1992) but it had serious design errors and limitations, making things even worse (this was later corrected and replaced with a totally new TIFF/JPEG specification).

But it was not before 1993 that Unisys finally became aware that the GIF file format, very popular already, was using their patent-protected LZW algorithm.
And CompuServe had no clue they were infringing on LZW patent.
In 1994 Unisys and CompuServe came to an understanding which, for various reasons, generated a huge protest reaction, the matter being reported by many newspapers including the Time Magazine.
Many upset developers and users removed their GIF files or converted them to JPEG (yes, JPEG again, it’s royalty-free!).
But JPEG uses lossy compression, so one of the protesting groups, formed by leaders of the online graphics community, began working on a lossless and patent-free version of GIF.
Their efforts produced the PNG specification.

As an epilogue, by 2004 all Welch (ie, Unisys) LZW patents expired in all countries where they were issued (IBM patent on LZW expired by 2006).
TIFF specifications are now controled by Adobe and LZW can be freely used with it.
Adobe uses for PDF a LZ-77 based compression algorithm named “DEFLATE”.
GIF format is still popular.
PNG became one of the most important graphics file formats in the world.

In the upcoming articles we will provide some explanations on bitmaps as well as some short overviews on the most common bitmap file formats, including TIFF, GIF and PNG.

Bye for now!


Big Browser on April 19

Netflix says it’s dumping Microsoft Silverlight and embracing HTML5, someday Read article Hijacking airplanes with an Android phone Read article A non-mathematical explanation of one way functions Read article Silicon Valley Goes Hollywood: Top Coders Can Now Get Agents Read article Plan your digital afterlife with Google's Inactive Account Manager Read article

Casual Friday on April 19

A duck family crosses the street