ImageMagick: how to minimally crop an image to a certain aspect ratio?

Imagemagick 7.0.7.22 and above -crop 3:2 works since January 6th, 2018. JPG magick convert in.jpg -gravity center -crop 3:2 out.jpg Warning/reminder: if you don’t use -gravity center, you will get two output files: PNG As fmw42 points out, PNG files store the virtual canvas size. +repage is recommended. magick convert in.png -gravity center -crop 3:2 … Read more

Documents and examples of PythonMagick

I could not find them anywhere either but this is how I went about using it anyway. Example import PythonMagick image = PythonMagick.Image(“sample_image.jpg”) print image.fileName() print image.magick() print image.size().width() print image.size().height() With output like this sample_image.jpg JPEG 345 229 To find out what image methods are available for example I looked in the cpp source. … Read more

ImageMagick command to convert and save with same name

Another way: convert *.jpg -resize 80% -set filename:f ‘%t’ ../’%[filename:f].jpg’ Will place converted files in the folder above. The option -set filename:f ‘%t’ sets the property filename:f to the current filename without the extension. Properties beginning with filename: are a special case that can be referenced in the output filename. Here we set it to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)