Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
This line of code does not work, it will not make the canvas a uniform 32x32. I have tried taking it and adding -canvas 32x32 or -extend 32x32 but then the script does not work at all.
I am doing this from PHP with exec so I do not get an error back.
I tested repage with both resize and thumbnail. In both cases the image canvas is coming out 9x32. Same was without repage. I read though the examples to come up with what I have now. Trim takes out all of the transparent space, but then the canvas does not reset to 32x32 with the resize.
If the white space is not trimmed evenly, then the image will not be square after the trim and your resize will not end up square. You can force it to be 32x32 exactly if you are willing to allow for some distortion from its actual aspect ratio by adding !. Depending upon your OS, you may need to escape the ! or put the argument into double quotes.
I tried that as well and it stretches the result to fit the size. I just want to have the same image but on a 32x32 canvas so all my thumbnails are 32x32.
Offering advice is far easier if we can see the image.
If the trimmed image isn't square, you must decide what you want to do: trim some of the image, or add some blank to make it square, or stretch the image.
snibgo wrote:Offering advice is far easier if we can see the image.
If the trimmed image isn't square, you must decide what you want to do: trim some of the image, or add some blank to make it square, or stretch the image.
We want to add some transparency to make it square.