A Note re Scanning and Capturing Images




When you’re scanning something, what file-format is best to use? Your scanning software will usually offer the choices of JPG, TIF, GIF, and PNG (or, PNG-8 and PNG-24). Or it may hide these behind the more generic “Document” or “Photograph” settings. The rule is simple, but most scanning software doesn’t really help to guide the user.

I generally use PNG-24.

About these formats..

The JPEG format yields files that end with the “.JPG” extension. This format compresses images to a smaller size (by “size”, I mean how much space it takes up on your disk). This is useful, but it comes at a price: it’s lossy. It dumps some information from the image, in order to squish it down. It works okay for photographs, depending upon your intent, because it’s designed to dump those parts that your eye won’t miss (much).  Are you going to do things to this image in Photoshop or other graphic progam? Then you do not want to use this format. It’s like recording audio onto magnetic tape in analogue format: with every generation of recording, you lose more information and it becomes increasingly degraded. In this case, it can be quite visually obvious very quickly.

The GIF file-format is not lossy in the same way. But it only captures the colors to a depth of 8 bits. That’s 8 bits total, not 8 bits per color. This is appropriate only if you’ve less than 256 colors in your image, and those are easily represented. Here, a sheet of white paper, with black lettering, is a good candidate. The GIF format will happily compresses all that white space. And it includes an ability to encode one of those 256 ‘colors’ as a transparency bit, meaning underlying colors will show through.

The PNG format is a successor to the older GIF format and is not a proprietary format as GIF is. It comes in two flavors: PNG-8 and PNG-24. PNG-8 is analogous to the GIF format in that it uses 8 bits to represent each pixel of the image, meaning it too can only encode 256 colors at a time.  But PNG-24 offers a full 24-bit range of colors for each pixel. It also offers the ability to display transparency, but now it’s a full 8-bit “alpha”, meaning it can show varying levels of transparency.

So which to choose?

If you choose PNG-24, your files will be larger. But they’ll contain all the image color information. They’re not “squished down”. You can open them in your favorite image-editing program and produce a highly-compressed JPEG from it anytime you want, with no ill effects on your original .PNG file.

I’d only save your original images in the JPEG format if you don’t really care about keeping or manipulating them in your image-editing program. If you’re scanning a photograph, and it produces JPEG files that are already small enough to send by email or post online, and that’s all you’re ever going to want of them, then have at it. Save it as JPEG. But if you use JPEG for your non-photograph documents, you’ll see ‘artifacts’ of the compression process around the lines and letters that degrade it’s appearance.

So in general, use PNG-24.

What about Dot Pitch?

For the same reason as above, I usually scan images at a pixel-resolution that is a bit higher than I’ll ultimately need, in order to have a more perfect ‘source’-image that I can then down-sample when needed.

For documents, I sometimes scan at 200dpi (dots per inch) if it’s a clear paper with easily-legible fonts, but generally I go to 300dpi or even higher if it merits the higher resolution.

When scanning pictures from a printed media such as a magazine, actually 75dpi or 150dpi would usually do except that you have the possibility of the moire effect messing up your image file. That, is an interaction between the scanner’s resolution, and the dot-pitch on the printed page. That can really make it ugly!

Thus for magazine photos, I avoid that by using an overly-fine resolution like 600dpi to scan the original, then I down-sample in Photoshop to reduce the resulting huge file. This is “over-sampling”. It does cure the problem. The caveat being that scanning is slower at this resolution, and the file sizes can be rather large. Even newspaper articles have this moire-effect problem and you may need to over-sample, even though the newspaper is only printed with a dot-pitch of perhaps 75 dpi. Some scanning software has a ‘compensate for moire effect’ option, which you may want to try out. Otherwise, it is a waste of disk space to scan at more than twice the resolution that the image was originally printed at.

Yes, it is an extra step – to fire up your image-editing program to down-sample your image file, or convert it to JPEG, etc. But usually you would have to do this anyway, to do a reasonably-precise job of cropping it, making it perfectly horizontal (ie, not tilted), and other processing tasks.

For other scanning tasks such as simple posters, or large photographs that don’t have a lot of fine detail or aren’t extremely sensitive in nature, it is a waste of disk space and time to scan at an excessively fine resolution. Tinker a bit, and find the resolution that gives you the results you want, and no higher.  For a large crude photograph, perhaps just 75 dpi and save it as JPEG. For a poster that has only a couple of colors, the PNG-8 format will do fine and often can yield a smaller file.

Higher Color-Depths

In this discussion of color depths where I state that PNG-24 will capture your full range of color information, I’ve bypassed the issue of color depths higher than 24 bits-per-pixel. 24 bits provides 8 bits per color, and is generally fine for a photo-realistic result. But some digital cameras are now yielding more than this. The newer Nikon and Canon DSLRs, for example, produce 14 bits per pixel in their sensors. As soon as you save it as JPG, you lose that extra information. The only option to preserve that image information is to save it as a ‘RAW’ –format file, which is the camera manufacturer’s own file format that preserves all the original color information. You can bring that into Photoshop CS4 and still preserve that higher color-depth, because Photoshop is capable of using 16 bits per color channel.

Similarly, some scanners now can save an image in a high color-depth format. In general, your workflow should depend upon your need. For common business-usage, you’ll never have need of more than 24 bits per pixel. If you’re scanning your great-uncles’ masterful oil painting that’s been hanging in a museum, you do want to preserve the full range of color information. For other images, that extra depth becomes useful only if you’re planning to manipulate the image extensively in Photoshop such that the higher color-depth stands up against loss of color information that comes from numeric rounding-errors that result from every processing step. But that’s a topic for a real Photoshop article.


About James W Hurst

a professional software designer since the beginning days of the desktop cptr and uC-controlled avionics, I today am focusing on Java, Swift, C# and F# for building mobile and desktop and online applications under Android, Xamarin.Forms, iOS, WPF, and ASP.NET-MVC along with the requisite HTML/CSS/JavaScript/Ajax for web applications. My database expertise has covered a panoply of different database-engines and modeling approaches, and my main area of academic interest is Artificial Intelligence and vision.
This entry was posted in beginner, Graphics, Microsoft Windows tips and techniques, Personal Effectiveness and tagged , , , . Bookmark the permalink.

One Response to A Note re Scanning and Capturing Images

  1. Your website is excellent. I m gonna read more, thank you.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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