Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
imagemagick [2009/05/29 07:25] geraldimagemagick [2024/02/29 13:36] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 95: Zeile 95:
  
 {{tag>imagemagick im convert identify composite}} {{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.1243581908.txt.gz · Zuletzt geändert: 2024/02/29 13:35 (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