Imagemagick: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=== Various commands for ImageMagick === Convert all PNG to JPG <pre> for x in `ls *.png` ; do convert "$x" "${x%.*}.jpg" ; done </pre> Appending an image to another image (pulled from my wallpaper changer code <pre> export BG_COLOR=black export FIN_IMAGE1=random.jpg export SPAN_SIZE_0=1024x768 convert "${FIN_IMAGE1}" -gravity "${GRAVITY_SPAN}" -background ${BG_COLOR} -resize ${SPAN_SIZE_0} -extent ${SPAN_SIZE_0} +append ${PWD}/background.jpg </pre> Category:ImageM...") |
mNo edit summary |
||
Line 12: | Line 12: | ||
export SPAN_SIZE_0=1024x768 | export SPAN_SIZE_0=1024x768 | ||
convert "${FIN_IMAGE1}" -gravity "${GRAVITY_SPAN}" -background ${BG_COLOR} -resize ${SPAN_SIZE_0} -extent ${SPAN_SIZE_0} +append ${PWD}/background.jpg | convert "${FIN_IMAGE1}" -gravity "${GRAVITY_SPAN}" -background ${BG_COLOR} -resize ${SPAN_SIZE_0} -extent ${SPAN_SIZE_0} +append ${PWD}/background.jpg | ||
</pre> | |||
Conversion from one format to another: | |||
<pre> | |||
convert file.png file.jpg | |||
</pre> | |||
resize | |||
<pre> | |||
convert file.jpg --resize 1024*768 file2.jpg | |||
</pre> | </pre> | ||
[[Category:ImageMagick]] | [[Category:ImageMagick]] |
Latest revision as of 09:19, 15 June 2023
Various commands for ImageMagick
Convert all PNG to JPG
for x in `ls *.png` ; do convert "$x" "${x%.*}.jpg" ; done
Appending an image to another image (pulled from my wallpaper changer code
export BG_COLOR=black export FIN_IMAGE1=random.jpg export SPAN_SIZE_0=1024x768 convert "${FIN_IMAGE1}" -gravity "${GRAVITY_SPAN}" -background ${BG_COLOR} -resize ${SPAN_SIZE_0} -extent ${SPAN_SIZE_0} +append ${PWD}/background.jpg
Conversion from one format to another:
convert file.png file.jpg
resize
convert file.jpg --resize 1024*768 file2.jpg