convert — Bilder konvertieren und bearbeiten (ImageMagick)

Praxis-Guide zu convert: Bilder zwischen Formaten umwandeln, skalieren, zuschneiden, drehen, Farben und Effekte anpassen mit ImageMagick (in v7: magick).

convert ist das Schweizer Taschenmesser von ImageMagick: ein einziges Kommando, das zwischen Dutzenden Bildformaten umwandelt, skaliert, zuschneidet, dreht, Farben anpasst, Effekte legt und sogar PDF-Seiten rendert. In ImageMagick 7 gilt convert zugunsten von magick als veraltet – magick input.png output.jpg ist die moderne Form, das klassische convert ruft sie intern auf und bleibt vorerst kompatibel. Dieser Guide zeigt dir die Aufrufe, die du im Alltag wirklich brauchst – vom schnellen Format-Wechsel bis zur Web-Optimierung.

Formatumwandlung

convert <input> <output> — Wandelt ein Bild in ein anderes Format um (bestimmt durch die Dateiendung).

convert photo.png photo.jpg

convert <input> -quality <n> <output> — Wandelt mit bestimmter Qualität um (1-100, für JPEG/WebP).

convert photo.png -quality 85 photo.jpg

convert <input> -define webp:lossless=true <output> — Wandelt in verlustfreies WebP um.

convert photo.png -define webp:lossless=true photo.webp

convert <input> -define png:compression-level=9 <output> — Wandelt in PNG mit maximaler Kompression um.

convert photo.bmp -define png:compression-level=9 photo.png

convert <input>[0] <output> — Extrahiert das erste Frame bzw. die erste Seite aus einem mehrteiligen Bild oder PDF.

convert animation.gif[0] first-frame.png

Skalieren & Größe ändern

convert <input> -resize <width>x<height> <output> — Skaliert auf eine maximale Größe (behält das Seitenverhältnis).

convert photo.jpg -resize 800x600 thumb.jpg

convert <input> -resize <width>x<height>! <output> — Erzwingt exakte Abmessungen (ignoriert das Seitenverhältnis).

convert photo.jpg -resize 800x600! stretched.jpg

convert <input> -resize <width>x<height>^ <output> — Skaliert, bis die Fläche gefüllt ist (eine Dimension darf überstehen).

convert photo.jpg -resize 800x600^ -gravity center -extent 800x600 cover.jpg

convert <input> -resize 50% <output> — Skaliert prozentual.

convert photo.jpg -resize 50% half.jpg

convert <input> -resize <width> <output> — Skaliert auf eine feste Breite (Höhe automatisch).

convert photo.jpg -resize 800 resized.jpg

convert <input> -resize x<height> <output> — Skaliert auf eine feste Höhe (Breite automatisch).

convert photo.jpg -resize x600 resized.jpg

convert <input> -thumbnail <width>x<height> <output> — Erzeugt ein Thumbnail (entfernt Metadaten, schneller als -resize).

convert photo.jpg -thumbnail 150x150 thumb.jpg

Zuschneiden & Beschneiden

convert <input> -crop <width>x<height>+<x>+<y> <output> — Schneidet einen Bereich an einem bestimmten Versatz aus.

convert photo.jpg -crop 400x300+100+50 cropped.jpg

convert <input> -gravity center -crop <width>x<height>+0+0 <output> — Schneidet aus der Bildmitte heraus.

convert photo.jpg -gravity center -crop 400x300+0+0 center.jpg

convert <input> -trim <output> — Entfernt Ränder bzw. einfarbige Flächen rund um das Bild.

convert logo.png -trim trimmed.png

convert <input> -fuzz <n>% -trim <output> — Beschneidet mit Farbtoleranz für annähernd gleichfarbige Ränder.

convert logo.png -fuzz 10% -trim trimmed.png

convert <input> -shave <x>x<y> <output> — Entfernt Pixel von allen Kanten.

convert photo.jpg -shave 20x20 shaved.jpg

Drehen & Spiegeln

convert <input> -rotate <degrees> <output> — Dreht das Bild um die angegebene Gradzahl.

convert photo.jpg -rotate 90 rotated.jpg

convert <input> -auto-orient <output> — Dreht automatisch anhand der EXIF-Orientierung.

convert photo.jpg -auto-orient corrected.jpg

convert <input> -flip <output> — Spiegelt vertikal (oben nach unten).

convert photo.jpg -flip flipped.jpg

convert <input> -flop <output> — Spiegelt horizontal (links nach rechts).

convert photo.jpg -flop flopped.jpg

convert <input> -transpose <output> — Spiegelt entlang der Diagonale von oben links nach unten rechts.

convert photo.jpg -transpose transposed.jpg

Farbanpassungen

convert <input> -colorspace Gray <output> — Wandelt in Graustufen um.

convert photo.jpg -colorspace Gray grayscale.jpg

convert <input> -modulate <brightness>,<saturation>,<hue> <output> — Passt Helligkeit, Sättigung und Farbton an (100 = unverändert).

convert photo.jpg -modulate 120,130,100 vibrant.jpg

convert <input> -brightness-contrast <b>x<c> <output> — Passt Helligkeit und Kontrast an (-100 bis +100).

convert photo.jpg -brightness-contrast 10x20 adjusted.jpg

convert <input> -negate <output> — Invertiert alle Farben (erzeugt ein Negativ).

convert photo.jpg -negate negative.jpg

convert <input> -level <black>%,<white>% <output> — Passt die Tonwerte an (setzt Schwarz- und Weißpunkt).

convert photo.jpg -level 10%,90% adjusted.jpg

convert <input> -normalize <output> — Streckt den Kontrast automatisch auf den vollen Bereich.

convert photo.jpg -normalize normalized.jpg

convert <input> -equalize <output> — Gleicht das Histogramm für besseren Kontrast aus.

convert photo.jpg -equalize equalized.jpg

convert <input> -colorspace CMYK <output> — Wandelt in den CMYK-Farbraum um (für den Druck).

convert photo.jpg -colorspace CMYK print-ready.tiff

Effekte & Filter

convert <input> -blur 0x<sigma> <output> — Wendet einen Gauß-Weichzeichner an.

convert photo.jpg -blur 0x3 blurred.jpg

convert <input> -sharpen 0x<sigma> <output> — Schärft das Bild.

convert photo.jpg -sharpen 0x1.5 sharp.jpg

convert <input> -unsharp <radius>x<sigma>+<amount>+<threshold> <output> — Wendet eine Unscharfmaske zum präzisen Schärfen an.

convert photo.jpg -unsharp 0x1+1+0.05 sharp.jpg

convert <input> -sepia-tone 80% <output> — Wendet einen Sepia-Effekt an.

convert photo.jpg -sepia-tone 80% sepia.jpg

convert <input> -vignette 0x<sigma> <output> — Fügt eine Vignette hinzu (abgedunkelte Ränder).

convert photo.jpg -vignette 0x20 vignette.jpg

convert <input> -charcoal <radius> <output> — Wendet einen Kohlezeichnungs-Effekt an.

convert photo.jpg -charcoal 2 sketch.jpg

convert <input> -edge <radius> <output> — Erkennt Kanten im Bild.

convert photo.jpg -edge 1 edges.jpg

convert <input> -emboss <radius> <output> — Wendet einen Prägeeffekt an.

convert photo.jpg -emboss 2 embossed.jpg

Text & Annotationen

convert <input> -gravity south -annotate +0+10 "<text>" <output> — Fügt eine Textannotation an einer Position hinzu.

convert photo.jpg -gravity south -fill white -pointsize 24 -annotate +0+10 "© 2026" annotated.jpg

convert -size <w>x<h> xc:<color> -font <font> -pointsize <n> -fill <color> -annotate +<x>+<y> "<text>" <output> — Erzeugt ein Bild aus Text.

convert -size 400x100 xc:white -font Arial -pointsize 36 -fill black -annotate +10+50 "Hello World" text.png

convert <input> -fill <color> -draw "rectangle <x1>,<y1> <x2>,<y2>" <output> — Zeichnet ein gefülltes Rechteck auf das Bild.

convert photo.jpg -fill "rgba(0,0,0,0.5)" -draw "rectangle 0,400 800,500" overlay.jpg

Metadaten & Optimierung

convert <input> -strip <output> — Entfernt alle Metadaten (EXIF, ICC-Profile, Kommentare).

convert photo.jpg -strip clean.jpg

convert <input> -interlace Plane <output> — Erzeugt ein progressives bzw. interlaced Bild.

convert photo.jpg -interlace Plane progressive.jpg

convert <input> -sampling-factor 4:2:0 -quality 85 -strip <output> — Optimiert JPEG fürs Web (kleinere Dateigröße).

convert photo.jpg -sampling-factor 4:2:0 -quality 85 -interlace Plane -strip optimized.jpg

convert <input> -colors <n> <output> — Reduziert die Anzahl der Farben.

convert photo.png -colors 256 reduced.png

convert <input> -depth <bits> <output> — Setzt die Farbtiefe (8, 16 usw.).

convert photo.png -depth 8 8bit.png

Erzeugen & Generieren

convert -size <w>x<h> xc:<color> <output> — Erzeugt eine einfarbige Fläche.

convert -size 800x600 xc:#336699 canvas.png

convert -size <w>x<h> gradient:<from>-<to> <output> — Erzeugt einen vertikalen Farbverlauf.

convert -size 800x600 gradient:blue-white gradient.png

convert -size <w>x<h> plasma: <output> — Erzeugt ein zufälliges Plasma-Fraktal.

convert -size 800x600 plasma: plasma.jpg

convert -size <w>x<h> pattern:<name> <output> — Erzeugt ein gekacheltes Muster (Schachbrett, Sechsecke usw.).

convert -size 800x600 pattern:checkerboard checkers.png

convert <input> -alpha set -background none -channel A -evaluate set <n>% <output> — Setzt eine gleichmäßige Transparenz.

convert logo.png -alpha set -background none -channel A -evaluate set 50% semi-transparent.png

Animation (GIF)

convert -delay <ticks> <frame1> <frame2> ... <output> — Erzeugt ein animiertes GIF aus Einzelbildern (Delay in 1/100 s).

convert -delay 20 frame-*.png animation.gif

convert <input> -coalesce <output> — Baut alle Frames zu Vollbildern auf (macht Optimierungen rückgängig).

convert animation.gif -coalesce frames.gif

convert <input> -layers Optimize <output> — Optimiert eine GIF-Animation für kleinere Dateigröße.

convert animation.gif -layers Optimize optimized.gif

convert <input> -loop <n> <output> — Setzt die GIF-Schleifenzahl (0 = endlos).

convert -delay 50 frame-*.png -loop 0 animation.gif

Fazit

convert deckt nahezu jede Bildoperation ab, die du auf der Kommandozeile brauchst – ob Stapelkonvertierung, Resize fürs Web oder schnelle Effekte. Behalte im Kopf, dass das klassische convert unter ImageMagick 7 als veraltet gilt: Für neue Skripte ist magick input.png output.jpg die empfohlene Form, und magick mogrify bearbeitet ganze Verzeichnisse in-place. convert überschreibt die Zieldatei kommentarlos – gib also nie versehentlich denselben Pfad als Ein- und Ausgabe an. Mit -strip entfernst du Metadaten (EXIF, GPS, ICC) vor der Veröffentlichung. Sicherheitshinweis: Die Verarbeitung von PDF-, PS- und SVG-Dateien lief historisch über Ghostscript und war wiederholt Angriffsfläche; ImageMagick schränkt riskante Formate deshalb per policy.xml ein. Verarbeite nicht vertrauenswürdige Bilddateien mit Vorsicht und passe die Policy nur bewusst an.

Verwandte Kommandos

  • mogrify – Bilder stapelweise und in-place bearbeiten und konvertieren
  • identify – Format, Abmessungen und Metadaten von Bildern auslesen
  • composite – Bilder überlagern und zu einem zusammenfügen