-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image Printing in Grayscale #1346
Comments
Hello! There's currently no built-in support for multi-tone (true grayscale) image printing in escpos-php, but here's a workaround; If you have one of the few Epson printers that can output multi-tone prints (TM-T70II, TM-T88V, TM-T88VI or TM-T88VII afaik) then you can use the Epson BmpToRaster utility (under Utilities) to convert your image into a multi-tone .bin-file. This .bin-file could then be read by your application and sent off to your printer. Here is a short example; <?php
require __DIR__ . '/vendor/autoload.php';
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
use Mike42\Escpos\Printer;
$connector = new NetworkPrintConnector("printer.example.com", 9100);
$printer = new Printer($connector);
try {
$multitone_image = file_get_contents("multitone-image.bin");
$printer->getPrintConnector()->write($multitone_image);
$printer->cut();
} finally {
$printer -> close();
}
?> I just tested the above on a TM-T88V and it came out as expected. If you are comfortable with using Python I'd suggest taking a look at my own utility for converting images into multi-tone images as well. It will most likely yield better results than BmpToRaster, and it'll run on Linux and Mac as well. It might also serve as inspiration for anyone else that would like to implement support for multi-tone images in escpos-php. |
After digging around I found out that Bixolon also has a couple of models that claim to support 16 levels of grayscale, namely the SRP-350plusIII and SRP-350plusV models. I skimmed through the Command Manual on Bixolon's website, but couldn't find any mention of how to send 4-bit image data to their printers. |
Hi,
I am printing an image, and currently, it seems like it just replaces the color with either 1 or 0 for black and white, making the image show just those 2 colors.
However, the printer is capable of more complex grayscale combinations, achieving better results when printing the image directly.
Is this possible already and I'm just missing how to do it? Or is there no capability for more complex color management and it will always just do 1/0 for black/white?
I am using Imagick extension.
Thank you!
The text was updated successfully, but these errors were encountered: