Skip to content
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

Lprint version 1.2 still prints "fuzzy" barcodes and text on LP2844 (Zebra EPL) label printer #91

Closed
brianbarr opened this issue Jan 2, 2023 · 11 comments · Fixed by #92
Assignees
Labels
enhancement New feature or request priority-high
Milestone

Comments

@brianbarr
Copy link

The fuzzy print dithering issue is still present, even when setting "-o print-color-mode=bi-level" for the printer.

The label with the "SAMPLE" overlay was generated by the Endicia app on a mac using a native epl driver on the same printer and it is crisp and legible vs the other label which was a barcode pdf and printed using lprint/airprint from a mac.

So the printer is not the issue.

Also there are a series of evenly spaced dots all over the label printed using lprint.

See attached magnified pictures..

IMG_8335

IMG_8336

@michaelrsweet
Copy link
Owner

Please attach the PPD file for the printer and a copy of the error_log file with debug logging enabled (cupsctl --debug-logging) showing a print job being sent to LPrint.

@michaelrsweet michaelrsweet linked a pull request Jan 4, 2023 that will close this issue
@michaelrsweet
Copy link
Owner

Hoping the new dithering algorithm will work around any issues like this - antialiasing effects render bar codes "fuzzy", and the new dithering algorithm attempts to detect these issues and clamp almost black/white areas so that the output is clearer.

@brianbarr
Copy link
Author

root@debian-lprint:# snap refresh lprint --channel=latest/edge
lprint (edge) 1.2.1 from Michael Sweet (michaelrsweet) refreshed
root@debian-lprint:
# reboot

I then printed two shipping labels and they came out blank.

@michaelrsweet michaelrsweet reopened this Jan 4, 2023
@michaelrsweet
Copy link
Owner

Still working out some kinks in the ZPL driver...

@tarikjn
Copy link

tarikjn commented Jan 22, 2023

I am also seeing significant dithering issues on 1.2 (haven't tested earlier versions) with a ZD-420 203dpi DT, using the zpl_4inch-203dpi-dt driver. Default macOS install & settings. I am seeing a fuzzy print using Shopify's test label.

macOS's 13.1 built-in CUPS driver also struggles with dithering on this test label but not as bad as lprint. Some labels come out crisp w/ built-in CUPS driver, so not a printer issue.

Lprint:
IMG_5178

macOS built-in CUPS:
IMG_5179

@bnemura
Copy link

bnemura commented Jan 23, 2023

Most content that would be sent to a monochrome label printer is black&white, even if it's effectively grayscale in an image or PDF. Therefore dithering is usually undesirable - it's better to use a simple threshold algorithm to convert to monochrome.
The main tricky case is logos which aren't already monochrome or pre-dithered.

I see -o print-content-optimize listed in documentation. But I didn't see lprint/pappl/cups[v2] doing anything real with the value (did I miss it?). This would seem to be the appropriate option to select whether dithering is done (and default off for lprint IMHO).
If there were a smart dithering algorithm that could detect regions of graphic content that are intended to be multi-color and only dither those regions, that would be ideal.

Also, it may be helpful to note that Zebra "Link-OS" printers (e.g. ZD*s) can accept most PDF documents directly, with "apl.enable" set to "pdf".

@michaelrsweet
Copy link
Owner

@bnemura The "print-content-optimize" attribute doesn't get a lot of usage, mainly because modern clients generally are producing 'text-and-graphic' content when printing from office apps, and 'photo' content isn't normally targeted for these label printers because they aren't well-suited to that sort of content... That said, the "print-color-mode" attribute is actually what you are looking for - 'monochrome' for shaded output and 'bi-level' for threshold.

What I've done for the next LPrint release (what is present in the master branch) is implement a specialized dithering and filtering algorithm that attempts to detect barcode content and threshold it while dithering everything else. This gets used for the "print-color-mode" 'auto' and 'monochrome' values, while 'bi-level' does thresholding exclusively.

WRT the PDF support in recent Zebra printers, that might be interesting to look at supporting but neither of my printers (GX420d and GX430t) seem to support it...

@michaelrsweet
Copy link
Owner

IMG_6012

Shopify label printed to my 203dpi Zebra GX420d with the current LPrint master branch...

@bnemura
Copy link

bnemura commented Jan 24, 2023

@michaelrsweet well done, sir! Still some minor artifacts, but overall very impressive. The DataMatrix looks a little borderline, but still scans off my screen! I don't have a barcode grader handy.
Thanks for clarification on print-color-mode.
I'll see if we can get you a newer model Zebra for dev/test :)

@michaelrsweet michaelrsweet self-assigned this Nov 24, 2023
@michaelrsweet michaelrsweet added enhancement New feature or request priority-high labels Nov 24, 2023
@michaelrsweet michaelrsweet added this to the v1.3 milestone Nov 24, 2023
@michaelrsweet
Copy link
Owner

So I'm going to close this out as "fixed" in 1.3 (next release real soon now). I do have a newer Zebra printer now and will investigate options for using the PDF support in a future release... Tracking that in issue #110.

@tarikjn
Copy link

tarikjn commented Jun 27, 2024

I can confirm that Shopify labels (including international) now all come out great!! 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority-high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants