-
Notifications
You must be signed in to change notification settings - Fork 45
Ghostscript (gstoraster): Introduce cupsHalftoneType dithering algorithms #92
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
Ghostscript (gstoraster): Introduce cupsHalftoneType dithering algorithms #92
Conversation
|
Is it fine to introduce new prefixed PPD option? Some proprietary filters already use cups-filters 1.x: OpenPrinting/cups-filters#642 |
zdohnal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks ok on syntax side of things, there are some space/tab issues against applied code style.
Regarding functionality I can't say, since I don't fully understand the best practices and it would be great if it was reviewed by an additional person.
|
Either way, thank you for the PR, @ValdikSS ! Ad new prefixed option - I would say it is fine, but probably @michaelrsweet should know more. |
c17cb8f to
5a71e53
Compare
zdohnal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one line scopes should not be enveloped by brackets, otherwise it looks great!
…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.
5a71e53 to
71742d2
Compare
zdohnal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
@michaelrsweet / @tillkamppeter can you review this from functioanity POV (meaning whether halftone implementation is correct)? I have check foo2zjs code and the Postscript code here is matching this PR, bi-level looks feasible with my little knowledge of Postscript, stocht.ps from ghostscript is accessible on machines which includes the script, so LGTM.
|
Principally, this code looks OK to me. Some remarks:
|
Yes.
Yes, I've tested on PDF files only.
Indeed, proper integration would be much better. Any suggestions?
poppler already has bi-level halftoning, and its default is much better than ghostscript's default. |
Add new dithering (halftone) algorithms in addition to the default Ghostscript one.
Controlled either with
halftone-typejob option orcupsHalftoneTypePPD option.stocht.psGhostscript library, just include it if cupsHalftoneType is set to yes/true/on/stochastic.Default algorithm
Stochastic algorithm
Foo2zjs algorithm