Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
imagemagick [2008/05/20 14:44] – angelegt geraldimagemagick [2024/02/29 13:36] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 ====== Imagemagick ====== ====== Imagemagick ======
 +http://www.imagemagick.org/script/command-line-options.php
 +
 +[[imagemagick:useful hints|Nützliche Hinweise]]
 +
 +
 +{{:magick.pdf|PDF-Dokument}}
 +
 +----
 +
 +Wichtig bei Verwendung von Crop:
 +
 +z.B. -crop 100x100 bescheidet das Bild, **aber**:
 +
 +Der Rest wird in Unterlayern abgelegt ([0] [1] etc.). Am Ende hat greift man dann meist auf das [0] zurück (darin liegt der Rest). Um das zu Unterbinden, verwende man:
 +
 +-crop 100x100+0+0
 + 
 +
    
  
Zeile 74: Zeile 92:
  
 Workaround: Getrennte Befehle... Workaround: Getrennte Befehle...
 +
 +
 +{{tag>imagemagick im convert identify composite}}
 +
 +===== File Handling =====
 +
 +[[http://www.imagemagick.org/Usage/files/]]
 +
 +
 +
 +===== PSD =====
 +
 +Photoshop-Datei mit Ebenen erzeugen:
 +
 +<code>
 +convert \( -page +0+0 -label "optional_label" 0006.jpg[0] -background none -mosaic -set colorspace RGB \) 
 +\( -page +0+0 -compose darken -label "optional_label2" 0007.jpg[0] -background none -mosaic -set colorspace RGB \) 
 +\( -clone 0--1 -background none -mosaic \) 
 +-alpha Off -reverse -compress JPEG "out.psd"
 +
 +
 +</code>
 +
 +
 +===== Breite der zu rechnenden Schrift berechnen =====
 +Quelle((https://stackoverflow.com/questions/32905448/render-text-string-to-image-to-calculate-length-with-wand-imagamagick-python))
 +
 +I need to calculate the length when rendered of a lot of strings using a custom font.
 +
 +
 +Can you use label: and let ImageMagick calculate the width needed for you?
 +<code>
 +convert -font "Arial" -pointsize 64 label:"this is the text" out.png
 +identify out.png
 +out.png PNG 396x73 396x73+0+0 8-bit sRGB 256c 2.57KB 0.000u 0:00.000
 +</code>
 +
 +or, more simply:
 +<code>
 +convert -font "Arial" -pointsize 64 label:"this is the text" -format %w info:
 +396
 +</code>
 +
 +or, as Eric suggested:
 +<code>
 +convert -font "Arial" -pointsize 64 label:"this is the text" -format %w +identify result.png
 +396
 +</code>
 +
 +Or, if you want to use annotate, you can make a larger canvas and trim it, like this:
 +<code>
 +convert -gravity west xc:white[1000x1000] -font "arial" -pointsize 32 -annotate 0 "this is the text" -trim -format %w info:
 +197
 +</code>
 +
 +
 +
 +
 +
 +
 
Nach oben
imagemagick.1211294686.txt.gz · Zuletzt geändert: 2024/02/29 13:36 (Externe Bearbeitung)
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0
DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp   Dogecoin Donations Accepted Here    DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp  DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp