Difference between revisions of "Imagemagick"

From Habitat: Giardino
Line 16: Line 16:
  magick convert /path/to/my/file.jpeg -dither FloydSteinberg -colors 3 export.png
  magick convert /path/to/my/file.jpeg -dither FloydSteinberg -colors 3 export.png


====


  magick convert /path/to/my/file.jpeg -colors 3 -colorspace gray -normalize
  magick convert /path/to/my/file.jpeg -colors 3 -colorspace gray -normalize

Revision as of 22:30, 7 June 2022

Imagemagick

Tricks

Gray Scale

 magick convert -set colorspace Gray -separate -average /path/to/my/file.jpeg  export.jpeg

Monochrome

Return bitmap

magick convert -monochrome /path/to/my/file.jpeg  export.png

Colors

The number of colours can be changed

magick convert /path/to/my/file.jpeg -dither FloydSteinberg -colors 3 export.png


magick convert /path/to/my/file.jpeg -colors 3 -colorspace gray -normalize

renders:

3 colors normalization