Skip to content

Ghostscript (gstoraster): Introduce cupsHalftoneType dithering algorithms #642

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

Open
wants to merge 2 commits into
base: 1.x
Choose a base branch
from

Conversation

ValdikSS
Copy link

Everything from libcupsfilters MR: OpenPrinting/libcupsfilters#92

Add new dithering (halftone) algorithms in addition to the default Ghostscript one.
Controlled either with halftone-type job option or cupsHalftoneType PPD option.

  • Stochastic algotirhm is implemented in stocht.ps Ghostscript library, just include it if cupsHalftoneType is set to yes/true/on/stochastic.
  • Foo2zjs algorithm is a PostScript code taken from foo2zjs-pstops file (don't know the name of the algorithm)

Default algorithm

dither-default

Stochastic algorithm

dither-stoh

Foo2zjs algorithm

dither-foo2zjs

Copy link
Member

@zdohnal zdohnal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks the same as libcupsfilters one - I have the same comments: some code style and request for someone who understands the functionality better.

@zdohnal
Copy link
Member

zdohnal commented May 28, 2025

Either way, thank you for the PR, @ValdikSS !

@ValdikSS ValdikSS force-pushed the ghostscript-dither-repo branch from 9e5bee7 to 035508c Compare May 29, 2025 17:45
@ValdikSS
Copy link
Author

Looks the same as libcupsfilters one - I have the same comments: some code style and request for someone who understands the functionality better.

Fixed, rebased and force-pushed.

@ValdikSS ValdikSS requested a review from zdohnal May 29, 2025 17:55
Copy link
Member

@zdohnal zdohnal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same as libcupsfilters.

@ValdikSS ValdikSS force-pushed the ghostscript-dither-repo branch from 035508c to 394f816 Compare May 30, 2025 10:22
@ValdikSS
Copy link
Author

The same as libcupsfilters.

Done

@ValdikSS ValdikSS requested a review from zdohnal May 30, 2025 10:22
Copy link
Member

@zdohnal zdohnal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the change - I have missed one place where we have to guard better against NULL, so it would be great if you looked into that.

@ValdikSS ValdikSS force-pushed the ghostscript-dither-repo branch from 394f816 to 40a6d35 Compare June 2, 2025 11:21
@ValdikSS ValdikSS requested a review from zdohnal June 2, 2025 11:23
ValdikSS added 2 commits June 8, 2025 23:15
…thms

Add new dithering (halftone) algorithms in addition to the default Ghostscript
one.
Controlled either with `halftone-type` job option or `cupsHalftoneType` PPD
option.

- Stochastic algotirhm is implemented in `stocht.ps` Ghostscript library,
  just include it if cupsHalftoneType is set to yes/true/on/stochastic.
- Foo2zjs algorithm is a PostScript code taken from foo2zjs-pstops file
  (don't know the name of the algorithm)
Similar to pdftoraster implementation.
@ValdikSS
Copy link
Author

ValdikSS commented Jun 8, 2025

Removed the stray ), fixed the compilation.

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

Successfully merging this pull request may close these issues.

2 participants