Abstract

Last Updated: February 23, 2014

EInk display differs from common LCD displays very much. Therefore, images that may lookgood on LCD display may often look bad on EInk display.YotaPhone SDK has several methods that help developer to improve image quality on EInkdisplay.The article describes image preprocessing methods of YotaPhone SDK and is intended forthird–party developers of back screen applications.

1. Dithering

Because EInk is 16 color display (16 degrees of gray) and LCD is 16777216 colors, imagedithering into less colors is a very natural thing.YotaPhone SDK supports two dithering algorithms:Atkinson dithering — should be applied for most images;Floyd-Steinberg dithering — should be used for pictures that has a lot of gradients;If a text or other kind of data should not be distorted then dithering shall not be applied.Dithering code exampleThere are two ways to apply dithering algorithm:

  1. Get dithered bitmap

    bitmap = EinkUtils.ditherBitmap(bitmap, ATKINSON_DITHERING);
    
  2. Send bitmap to drawing with dithering flag

    getBSDrawer().drawBitmap(0, 0, bitmap, BSDrawer.Waveform.WAVEFORM_GC_PARTIAL, EinkUtils.ATKINSON_DITHERING);
    

2. Image sharpening

EInk display adds a certain amount of blur to the image. Image sharpening helps to counteractthis effect.For image sharpening we use convolution matrix

image

YotaPhone SDK has embedded function for image sharpening.

Image sharpening code exampleThis will sharp the image with value of image

bitmap = BitmapUtils.sharpenBitmap(context, bitmap, 0.15f);

3. Contrast and Brightness

Contrast enhancement is also used to counteract the blurring effect of the EInk display.Because contrast alteration also changes the image brightness, the brightness should bechanged to opposite direction.Contrast and brightness code exampleThis will enhance contrast by factor of 1.2 and decrease brightness by -30

bitmap = BitmapUtils.changeBitmapContrastBrightness(bitmap, 1.2f, -30)

4. Standard image processing

It is recommended to use the following preprocessing sequence for all the images that you are displaying on back screen, in this specific order:

  1. Sharpen the image with image
  2. Enhance contrast by factor of 1.2 and decrease brightness by -30;
  3. Applying Atkinson dithering algorithm to convert it to 16 colors.

Code ExampleYotaPhone SDK has embedded function to apply first two steps:

bitmap = BitmapUtils.prepareImageForBS(context, bitmap);

And then as last step Atkinson dithering shall be applied:

getBSDrawer().drawBitmap(0, 0, bitmap, BSDrawer.Waveform.WAVEFORM_GC_PARTIAL, EinkUtils.ATKINSON_DITHERING);