diff --git a/MANPAGE.md b/MANPAGE.md index ce8edd3..692f903 100644 --- a/MANPAGE.md +++ b/MANPAGE.md @@ -3,8 +3,8 @@ title: DIDDER section: 1 header: User Manual -footer: didder -date: May 01, 2021 +footer: didder v1.0.0-3-g2404e20 +date: May 09, 2021 --- # NAME @@ -22,7 +22,7 @@ The most important parts of this manual are highlighted in the **TIPS** section, Homepage: -# GLOBAL OPTIONS +# OPTIONS **-i**, **\--in** *PATH* Set the input file. This flag can be used multiple times to dither multiple images with the same palette and method. A *PATH* of \'**\-**' stands for standard input. diff --git a/README.md b/README.md index 7bfb24d..8690aaa 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ didder is an extensive, fast, and accurate command-line image dithering tool. It is designed to work well for both power users as well as pipeline scripting. It is backed by my [dithering library](https://github.com/makeworld-the-better-one/dither), and is unique in its correctness and variety of dithering algorithms. No online or offline tool I know of provides as many options, while being correct (linearizing the image). -It does not support images that make use of the alpha channel (transparency), but it will in the future. ## Types of dithering supported @@ -48,6 +47,7 @@ More methods of dithering are being worked on, such as Riemersma, Yuliluoma, and - Process multiple images with one command - Combine multiple images into an animated GIF - Uses all CPU cores when possible +- Support images with transparency (alpha channel is kept the same) ## Installation diff --git a/didder.1 b/didder.1 index 806249c..aa24104 100644 --- a/didder.1 +++ b/didder.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 2.13 .\" -.TH "DIDDER" "1" "May 01, 2021" "didder " "User Manual" +.TH "DIDDER" "1" "May 09, 2021" "didder v1.0.0-3-g2404e20" "User Manual" .hy .SH NAME .PP @@ -22,7 +22,7 @@ The most important parts of this manual are highlighted in the \f[B]TIPS\f[R] section, make sure you check it out! .PP Homepage: -.SH GLOBAL OPTIONS +.SH OPTIONS .TP \f[B]-i\f[R], \f[B]--in\f[R] \f[I]PATH\f[R] Set the input file. diff --git a/didder.1.md b/didder.1.md index e652371..b36d0ba 100644 --- a/didder.1.md +++ b/didder.1.md @@ -21,7 +21,7 @@ The most important parts of this manual are highlighted in the **TIPS** section, Homepage: -# GLOBAL OPTIONS +# OPTIONS **-i**, **\--in** *PATH* : Set the input file. This flag can be used multiple times to dither multiple images with the same palette and method. A *PATH* of \'**\-**' stands for standard input. diff --git a/go.mod b/go.mod index 5144f41..7c5bf7d 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/disintegration/imaging v1.6.2 - github.com/makeworld-the-better-one/dither/v2 v2.1.0 + github.com/makeworld-the-better-one/dither/v2 v2.2.0 github.com/urfave/cli/v2 v2.3.0 golang.org/x/image v0.0.0-20210220032944-ac19c3e999fb ) diff --git a/go.sum b/go.sum index b6374b0..40fe363 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4= -github.com/makeworld-the-better-one/dither/v2 v2.1.0 h1:ihYRtKQDkZwZutaCeRf1vYaq1Jqoy2mZGZR8BNZZK2I= -github.com/makeworld-the-better-one/dither/v2 v2.1.0/go.mod h1:VBtN8DXO7SNtyGmLiGA7IsFeKrBkQPze1/iAeM95arc= +github.com/makeworld-the-better-one/dither/v2 v2.2.0 h1:VTMAiyyO1YIO07fZwuLNZZasJgKUmvsIA48ze3ALHPQ= +github.com/makeworld-the-better-one/dither/v2 v2.2.0/go.mod h1:VBtN8DXO7SNtyGmLiGA7IsFeKrBkQPze1/iAeM95arc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= diff --git a/subcommand_helpers.go b/subcommand_helpers.go index be1fc2c..1019c35 100644 --- a/subcommand_helpers.go +++ b/subcommand_helpers.go @@ -257,8 +257,8 @@ func recolor(src image.Image) image.Image { b := img.Bounds() for y := b.Min.Y; y < b.Max.Y; y++ { for x := b.Min.X; x < b.Max.X; x++ { - // Image pixel -> convert to RGBA -> find palette index using `m` - // -> find recolor palette color using index -> set color + // Image pixel -> convert to RGBA -> find recolor palette color using map + // -> set color img.Set(x, y, paletteToRecolor[color.RGBAModel.Convert(img.At(x, y))]) } } diff --git a/subcommands.go b/subcommands.go index c6a625c..30db0f6 100644 --- a/subcommands.go +++ b/subcommands.go @@ -100,6 +100,7 @@ func preProcess(c *cli.Context) error { r, g, b, _ := c.RGBA() if r != g || g != b { grayscale = false + break } } }