Ghostscript (gstoraster): new halftone/dithering algorithms#160
Merged
Conversation
Controlled either with `halftone-type` job option or `cupsHalftoneType` PPD option. halftone-type=dithering or cupsHalftoneType=dithering Square 8×8 ordered dither, contributed to Ghostscript by Gregg Townsend.
Advanced ordered dithering halftone screen algorithm, controlled either with
`halftone-type` job option or `cupsHalftoneType` PPD option.
halftone-type=genordered[-frequency][-angle][-dotshape]
frequency - line-per-inch, number of halftone cells per inch.
Lower produces larger dots, higher - smaller.
Values good for 203DPI label printer: 50-60
600DPI laser printer: 106-150
angle - screen orientation, in degrees.
dotshape - one of:
0=CIRCLE, 1=REDBOOK, 2=INVERTED, 3=RHOMBOID, 4=LINE_X, 5=LINE_Y,
6=DIAMOND1, 7=DIAMOND2, 8=ROUNDSPOT
Examples
halftone-type=genordered-60-45
halftone-type=genordered-133-135-8
More information could be found in Ghostscript documentation:
https://ghostscript.readthedocs.io/en/gs10.07.1/Language.html#:~:text=%2Egenordered
Advanced ordered dithering halftone screen algorithm, controlled either with
`halftone-type` job option or `cupsHalftoneType` PPD option.
halftone-type=spot[-frequency][-angle][-dotshape]
frequency - line-per-inch, number of halftone cells per inch.
Lower produces larger dots, higher - smaller.
Values good for 203DPI label printer: 50-60
600DPI laser printer: 106-150
angle - screen orientation, in degrees.
dotshape - one of:
0=SimpleDot 1=InvertedSimpleDot 2=DoubleDot 3=InvertedDoubleDot 4=CosineDot
5=Double 6=InvertedDouble 7=Line 8=LineX 9=LineY 10=Round 11=Ellipse
12=EllipseA 13=InvertedEllipseA 14=EllipseB 15=EllipseC 16=InvertedEllipseC
17=Square 18=Cross 19=Rhomboid 20=Diamond
Examples
halftone-type=spot-60-45-20
halftone-type=spot-133-135-4
More information could be found in PDF specification, pages 303-307:
https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf
This was referenced Jun 22, 2026
Member
Author
|
Quite unfortunate that the MR got squashed, as the commit messages contain useful information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add new dithering and halftoning algorithms in addition to the existing
stochastic,bi-levelandfoo2zjsalgorithms.Controlled either with
halftone-typejob option orcupsHalftoneTypePPD option.dithering, forces 8x8 ordered dithering (no halftone) used only for low DPI in Ghostscript by defaultgenordered, a configurable halftone+ordered dithering algorithmspot, a configurable halftone algorithm from PDF specificationfull readme is in 1.x commit, and in commit messages
ditheringis mostly useful for label and other low-DPI printers, other algorithms are for all printers.Source image
Stock configuration, no halftone-type
Stochastic
8x8 Dithering
genordered-60-135
spot-60-135