Posts Tagged ‘PaperScan’

More on interpolation in bitmaps

Hi folks,

Today we are going to provide some more details on interpolation algorithms, not because we intend to annoy you with mathematics but just as an attempt to offer simple explanations to terms you might have encountered and puzzled you in imaging and photo processing documentations.
Or at least to give you a clue on the complexity that lays behind even very basic PaperScan bitmap handling features you are frequently and easily using, such as resizing an image/changing its dpi, rotating it at any angle you want or using the magnifier tool.

As shortly explained in a previous article, interpolation is a mathematically-based “guess” for determining new, unknown values to be placed in between known values (as opposed to extrapolation, when new values are guessed for outside the range of the known values).
Quick example: we know the air temperatures at 6:00 AM and at 10:00 AM and need to figure out a best guess for the temperature at 8:30 AM (interpolation) or at 11:45 AM (extrapolation).
In bitmaps, interpolation is required for example when scaling an image (more obvious when enlarging it) or when rotating an image with an angle, because bitmaps are a given, fixed grid of pixels and therefore resolution-dependent.
Being an approximation process, there will always be some loss of quality when interpolation is performed, the results depending on the interpolation algorithm used.

As mentioned before, among the many existing methods there are 3 commonly used algorithms for bitmap image interpolation: nearest-neighbor, bilinear and bicubic.

1) Nearest neighbor algorithm is the simplest of them all.
An image is worth a thousand words, so take a look here : the original image (left) is 4×4 pixels, the 100% upscaled grid (middle) is 8×8 pixels, showing the to-be-created (with color value to be determined), “empty” pixels as black, for ease of understanding.
Now start from upper-left corner going to the right and assign to each “empty” (black) pixel the same color as its nearest known neighbor and, after finishing a row, go to the next one under it until completing all of them.
The resulting grid is shown on the right and you have just performed (mentally) a nearest-neighbor interpolation!
It is simple, blazing fast but only makes each original pixel bigger so how about seeing its shortcomings? Here you go: http://photoenlargement.imagener.com/images/nn.jpg

2) Bilinear algorithm is “smarter”:
Instead of simply replicating the nearest pixel, it takes into account the closest 2×2 neighborhood of known pixels that surrounds the “empty” (to-be-created) pixel.
It then determines the new (interpolated) value by calculating the average of these 4 known pixels, weighted according to their relative distance to the to-be-created pixel.
Resulting images are much smoother compared to those obtained by nearest-neighbor method.

3) Bicubic algorithm is more complex than bilinear and, because it offers very good quality of output in a short enough processing time, it became a standard for image editing software, as well as for printer drivers.
Bicubic method takes into account 16 (4×4) known pixels located closest to the “empty” one, whose color value is to be determined.
That value will still be a weighted average and the closer a known pixel is, the more weight he will get in the calculation.
This is the most accurate interpolation method of the 3 presented here providing a smooth and sharp output which explains its wide adoption.
If you kept all 3 sample images (links provided above) in separate browser tabs, you can easily compare and see the differences between algorithms.
Note that any algorithm’s efficiency is limited so, when pushed beyond a certain margin, it will start producing lesser and lesser quality output.

As a conclusion to this article, each time you zoom, resize, rotate, crop a zone of a bitmap to another resolution or print, remember the result is “artificial” and, despite the ease of use, it is obtained by non-trivial methods.
Interpolation is a nice thing (and it has a cool name, too), but best idea for your valued images/photos would be to adjust initial resolution settings so you will need it as rarely as possible.

See you next week!

Bogdan

Big Browser on May 17

Samsung Faces Same Problem As Apple : Too Much Cash Read article The Windows Kernel Is Slower Than Other Operating Systems. Here Is Why. Read article Is the Linux desktop becoming extinct? Read article The top 6 worst passwords from the Star Trek universe Read article Microsoft: Office won’t go subscription-only any time soon Read article

Casual Friday on May 17

You talking to me?

You talking to me ?"

What’s WIA

Hi folks,

After having presented previously the basic idea about scanner drivers as well as the bottom line on TWAIN, today we will try to shed some light on WIA.

Wikipedia definition reads: “Windows Image Acquisition (WIA; sometimes also called Windows Imaging Architecture) is a Microsoft driver model and application programming interface (API) for Microsoft Windows ME and later Windows operating systems that enables graphics software to communicate with imaging hardware such as scanners, digital cameras and digital video-equipment.”

So what does it mean from a user’s point of view ? And how is WIA different from TWAIN?

Well, to begin with, both TWAIN and WIA goal is to connect various imaging devices to various imaging softwares.

But…

-TWAIN is meant to be an industry standard (covering all image acquisition devices, for all Operating Systems) while WIA is a vendor (Microsoft) API provided to image acquisition device manufacturers for Windows Operating Systems only.

-WIA is said to offer better support when it comes to digital cameras while TWAIN has a strong orientation towards scaners.

-both TWAIN and WIA allow scanning operation control via dialog or programatically (with no dialog showed).
WIA uses a common dialog for all devices while TWAIN uses the dialog created by the device manufacturer.

-when scanning in duplex mode, TWAIN supports options for each side of the page while WIA uses the same settings for both sides.

-if the device manufacturer has created custom capabilities, TWAIN allows you to use them even though they don’t exist in the TWAIN specifications.

-WIA provides a transparent compatibility layer which allows TWAIN compatible applications to employ and use WIA-driver-based devices.

Remember that PaperScan supports both TWAIN and WIA so it provides users with universal image acquiring feature and full image and document processing power!

See you next week!

Bogdan

Big Browser on April 12

Blink. Chrome’s new rendering engine Read article WebKit Group Strikes Back: Let's Remove Chrome Read article PC Sales Decline In Q1 2013: The Worse in Last 20 Years, sais IDC Read article From touch displays to the Surface: a brief history of touchscreen technology Read article Apple New Campus Cost Seen Jumping to $5 Billion Read article

Casual Friday on April 12

You can't have them both

Happy New Year! Bonne Année !

First of all the ORPALIS Team wishes you all the best for 2013!

Did you take any resolution for the New Year?
At ORPALIS we prepared a little list to start the year off right…

Resolution 1

Download our latest software for the general public: ORPALIS PDF Reducer
ORPALIS PDF Reducer is a powerful PDF compression Software for end users and developers meant to help anyone to get existing PDF files reduced up to 80% more than concurrent products.

The Free Edition is now available for Windows with the following features:

  • Content segmentation and optimal compression
  • Automatic color detection and layout analysis
  • Embedded raster images re-sampling and re-composition
  • Fast web view support (linearization)
  • Remove unwanted or unused objects such as annotations, formfields, bookmarks…
  • Unlimited batch processing (with nag-screen every 5 files)
  • Drag ‘n Drop support

read more about pdf reducer

The interface is really intuitive and currently available in three languages: English, French and Romanian.
You can find a short video which works as a tutorial on the website www.findmysoft.com at the PDF Reducer page.
Tell us what you think about PDF Reducer on its dedicated section of the ORPALIS forum !

Resolution 2

Go to the ORPALIS Facebook page.
We have a special application waiting for you: the PaperScan 2013 Giveaway Sweepstake app.

For 2013 we decided to give a gift to our Facebook fans: each week, starting now until the end of December 2013, anyone can win a PaperScan Home Edition license!

To participate, just click on the app and follow the steps.
The app is located on the top right of the page, next to the number of fans, here.

Resolution 3

Keep in touch!
Connect with us on Facebook of course, but also on Twitter, Google + and via our RSS feed
We also have a newsletter: you can register here.

This way you will be the first to know about our latest events, releases and promotions!

ORPALIS FacebooktwitterORPALIS Google+ORPALIS RSSORPALIS Newsletter

Resolution 4

Take care!

Cheers!

The ORPALIS Team

Automatic color detection: how to dramatically reduce the size of your documents

Hi folks,

In this article we are going to explain to our general public what color detection is all about and how can it be used to dramatically reduce the size of your electronically stored documents.

In a previous article, we were showing that bitmaps (or raster images) are made of pixels (ordered in arrays or matrices, each pixel having its own coordinates and color) in a way similar to how mosaics are made out of pieces of coloured glass.
Since bits (“0″ and “1″) are used to store information about color, it is quite logical that, the more colours need to be encoded in an image, the more bits per pixel (or “bpp”) are necessary to store that information and therefore, the larger the size of the bitmap image file will be.

From a color point of view, bitmaps can be:

– Black and white
Being only 2 colors, they are encoded in 1 bpp (either “0″ or “1″ for either black or white) so these bitmaps consumes less size the lesser possible size for color information.

– Grayscale

Such images are in black, white and various sets of intermediary grey shades.
Generally, a 8 bpp color encoding is considered acceptable, but you will note that each pixel color requires already 8 times more data than for the B/W images.

– Color

Images are colored in nuance (color gradation) palettes of various sizes but 24 bpp color encoding is considered to be satisfactory as it can store over 16,7 million colours while the human eye can discern only about 10 million.
Of course, each pixel color for such images takes 3 times more data than the 8 bpp and 24 times more data than the 1 bpp.

Now, why is all this so important?

In real life, not only the professionals in document storage but also most of us are forced to compromise between the needs of storing documents at as high quality as possible but at smallest possible size (mainly for sharing purposes).
To achieve that, scanning operators have to separate B/W pages from grayscale and from colored ones and scan each of those sets at 1 bpp, 8 bpp and 24 bpp, respectively.
This is a terribly slow, painful and subject to human error task.

What if everything could be done instantly, automatically and with no scanning constraints?

Well, we at ORPALIS have developed a patent pending, proprietary technology of automatic color detection.
All you have to do is put all your documents in one batch, no matter their color type, scan them all in color mode and our software will automatically determine the color type of each page.
Then, depending on the detected color-type, the filter will automatically encode the image in its best suited / optimized bits-per-pixel encoding.
In other words, providing best quality for smallest possible size.

This feature is already implemented in PaperScan Pro starting with version 1.6 and will be fully programmatically available in next GdPicture.NET major release.

Care for a practical testing?

Make sure you have latest PaperScan Pro (even a trial version) installed.
For your convenience, we provide a 3 TIFF test files in a zipped folder to use for batch import, but you can test using your own images, either acquired from scanner or importing existing images files.
Each TIFF file is bigger than 1 MB so the 3 will total more than 3 MB in size.
Now save them in PDF multipage format.
The resulting PDF file (PaperScan creates it using JPEG optimization and PDF pack technology) will be about 800 kb in size.
Not bad, but if you think we can’t do even better, you’ll have to think again!

From the main menu, go to “Options / Batch Acquisition/Import Filters…“.

PaperScan Pro Batch Acquisition/Import Filters...

PaperScan Pro Batch Acquisition/Import Filters…

Select “Automatic Color Detection” option and click “Save

PaperScan Pro Automatic Color Detection

PaperScan Pro Automatic Color Detection

Now import the TIFF files again and save as multipage PDF : the resulting file is 65 kb in size !
Ta-daaam!

Our next step is to provide automatic color detection for regions of same single document.
This will be available for end-users since one of the upcoming PaperScan versions and, of course, programmatically for developers using our next GdPicture.NET toolkit!

Cheers!

Bogdan

We’ve just released PaperScan 1.5 !

paperscan

Hi folks,

We’ve just released PaperScan 1.5 !

Besides a battery of fixes (including a memory leak on PDF import bug fix ), this medium upgrade provides new useful features and handy options meant to bring you more ergonomy and comfort.

We’ve added an extra option (Main menu / Options / Extras) allowing you to define which resolution to use (1 to 600 dpi, incrementing by 50) in PDF vector data to raster conversion when importing PDF files.

Speaking of document importing, you can now import files by dragging them from Windows Explorer and dropping in the thumbnail panel of PaperScan as an alternative to the Import option in Main menu.
In the main Viewer we’ve added context menu (appears on mouse right-click) allowing you to Save or Remove the currently displayed image.

Learn more ...