Difference between revisions of "Imagemagick"
From Habitat: Giardino
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Imagemagick == | == Imagemagick == | ||
=== Basic === | |||
convert file.jpeg -resize 2000x2000 output-2000.jpg | |||
Images are enlarged or reduced just enough so as to best fit into the given size. | |||
<hr> | |||
convert file.jpeg -bordercolor yellow -border 50 output-border.jpg | |||
Creates a yellow border of 50px | |||
<hr> | |||
convert -charcoal 5 charcoal.jpeg | |||
Charcoal effect. "5" is the value. | |||
=== Tricks === | === Tricks === | ||
Line 9: | Line 27: | ||
Return bitmap | 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: | |||
[[File:May-2022--Amro.jpeg|thumb|3 colors normalization]] |
Latest revision as of 22:33, 7 June 2022
Imagemagick
Basic
convert file.jpeg -resize 2000x2000 output-2000.jpg
Images are enlarged or reduced just enough so as to best fit into the given size.
convert file.jpeg -bordercolor yellow -border 50 output-border.jpg
Creates a yellow border of 50px
convert -charcoal 5 charcoal.jpeg
Charcoal effect. "5" is the value.
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: