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

pwgtoraster has small black dots. #20

Closed
tianmax opened this issue Mar 18, 2023 · 3 comments
Closed

pwgtoraster has small black dots. #20

tianmax opened this issue Mar 18, 2023 · 3 comments

Comments

@tianmax
Copy link

tianmax commented Mar 18, 2023

  1. When I run this command:
    ./pwgtoraster 1 user Test 1 "print-color-mode=Black printer-resolution=600x600dpi" windows-testpage.raster > 1.raster
  2. And run command:
    rasterview 1.raster
    3.I found that the converted document had many small black dots, and the same was true when printed.

Thanks.
windows-testpage.raster.zip

@tianmax
Copy link
Author

tianmax commented Mar 21, 2023

I found (pwgtoraster_doc_t *) doc ->bi_ Level=1, which can solve this problem.

Thank you for your great efforts.

@tianmax tianmax closed this as completed Mar 21, 2023
tillkamppeter added a commit that referenced this issue Apr 5, 2023
When converting 8-bit grayscale (Black = 0, White = 255, 256 steps) to
1-bit dithered (16x16 dither matrix, Black = 0 pixels, White = 256
pixels, 257 steps), White got converted from 255 to 255 pixels in the
16x16 dither matrix, leaving 1 pixel in each 16x16 square black. Fixed
this off-by-one by explicitly setting all 256 pixels for white.

Fixes issue #20
@tianmax
Copy link
Author

tianmax commented Apr 12, 2023

I found:
if (*src >= threshold){
t |= 0x1;
}
It can also solve this problem, you can refer to it. Thank you very much for the recovery.

1 similar comment
@tianmax
Copy link
Author

tianmax commented Apr 12, 2023

I found:
if (*src >= threshold){
t |= 0x1;
}
It can also solve this problem, you can refer to it. Thank you very much for the recovery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant