Skip to content
Marco Antonio Anastacio Cintra edited this page Sep 9, 2020 · 5 revisions

Requirements

  • one image.
  • one Bitonal implementation algorithm to define the dithering.
  • one ImageWrapperInterface implementation to determine the command set to be used.

The image

One regular image (png, jpg...)

The Bitonal implementation algorithm

We have two buitin implementation for this:

BitonalThreshold:

output

// using bitonal threshold for dithering
Bitonal algorithm = new BitonalThreshold(); 

BitonalOrderedDither:

output

Bitonal algorithm = new BitonalOrderedDither();

Dithering sample

The ImageWrapperInterface implementation

As you can see, we have three implementation, but wich one is the best choice? To answer this you need to know about your printer cababilities and what of this works better for you, you can test printer speed and quality of the printed image. Personally, my preference of use is RasterBitImageWrapper, then GraphicsImageWrapper and than BitImageWrapper,

RasterBitImageWrapper

This implementation of ImageWrapperInterface uses esc/pos sequence: "GS 'v' '0'"

RasterBitImageWrapper imageWrapper = new RasterBitImageWrapper();

sample RasterBitImageWrapper

GraphicsImageWrapper

This implementation of ImageWrapperInterface uses esc/pos sequence: "GS(L"

GraphicsImageWrapper imageWrapper = new GraphicsImageWrapper();

sample GraphicsImageWrapper

BitImageWrapper

This implementation of ImageWrapperInterface uses esc/pos sequence: "ESC '*'"

BitImageWrapper imageWrapper = new BitImageWrapper();

sample BitImageWrapper

extensive images

if you whant to print ample images like one long receipt, then take a look at Slice image sample

EscPos Coffee Wiki Content


About EscPos Coffee



Input


FAQ

Clone this wiki locally