Skip to content

Commit

Permalink
Merge pull request #33 from pushd/dither_options_20240506
Browse files Browse the repository at this point in the history
"options set 01" parameters - cam-16 options
  • Loading branch information
jtomson authored May 7, 2024
2 parents 4608ff6 + 8652b2c commit b5f0a95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions options/processing_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ type DitherOptions struct {
SaturationScale float64
NormalizeContrast bool
CLAHESize int
OptionsSet01 bool // shorthand for a set of options starting with the 20240506 release
}

type WatermarkOptions struct {
Expand Down Expand Up @@ -763,6 +764,8 @@ func applyDitherOption(po *ProcessingOptions, args []string) error {
po.Dither.LUTFile = "rgb_13.interpol_clarabel"
case "hpmrgb":
po.Dither.LUTFile = "hpminde_rgb"
case "opts01":
po.Dither.OptionsSet01 = true // shorthand for a set of options starting with the 20240506 release
default:
if err := maybeParseNumericDitherOptions(po, arg); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion plugins/pushd-dither
10 changes: 10 additions & 0 deletions processing/dither.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ func shellOutDither(inFile string, po *options.ProcessingOptions) error {
cmdArgs = append(cmdArgs, "--normalize-contrast")
}

if po.Dither.OptionsSet01 {
cmdArgs = append(cmdArgs, "--cam16")
cmdArgs = append(cmdArgs, "--chroma-lightness")
cmdArgs = append(cmdArgs, "--saturation-scale", "1.0")
cmdArgs = append(cmdArgs, "--hull-project")
cmdArgs = append(cmdArgs, "--pal-meter-13-hack")
cmdArgs = append(cmdArgs, "--contrast")
cmdArgs = append(cmdArgs, "--shrink-gamut", "1.5")
}

cmd := exec.Command("python3", cmdArgs...)
cmd.Dir = "/opt/pushd-dither"
output, err := cmd.CombinedOutput()
Expand Down

0 comments on commit b5f0a95

Please sign in to comment.