I have jpg images that are 4096x4096,
I want to extend the canvas 300 px on both sizes centering the image on the new canvas with transparent background for the new canvas only
So I do not want to change the original image, just pad it on both sides, and convert from jpg to png for transparency background.
This command will work without extending it:
convert in.jpg -alpha set -gravity center -extent 4096x4096 out.png
This one aborts with core dump
convert in.jpg -alpha set -gravity center -extent 4696x4096 out.png
I have tried -format png -resize 4096x4096
and Updated: -background none
mogrify also fails.
This will run as a bash command on over 100,000 files, so speed and quality is best
Running on Linux Manjaro (Arch Linux Clone)
convert -version
Version: ImageMagick 6.9.9-21 Q16 x86_64 2017-10-31 http://www.imagemagick.org
Features: Cipher DPC HDRI Modules OpenCL OpenMP
Delegates (built-in): bzlib cairo fontconfig freetype gslib jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png ps raw rsvg tiff webp wmf x xml zlib
Update: Upgrading to 7 fixed the issue.
Thanks
convert -extent not working [Solved]
convert -extent not working [Solved]
Last edited by Flesh on 2017-11-07T16:26:23-07:00, edited 2 times in total.
Re: convert -extent not working
Try:
Code: Select all
convert in.jpg -background none -gravity center -extent 4696x4096 out.png
Re: convert -extent not working
Thanks, but it did not help.
Re: convert -extent not working
I recommend you try my code on a different computer/server and see if it works.
What did or did not happen?Thanks, but it did not help.
Re: convert -extent not working
That was it, just this machine, the other is setup the same, tired to reinstall imagemagick, no help; so this sucks.
It might be related to this:
https://www.imagemagick.org/discourse-s ... hp?t=24603
I am using opencl-nvidia for cuda in blender; just a guess, but I have it on the other machine also; the only difference I see in machines is AMD vs Intel, and its the Intel machine that is breaking, an i7.
I did need -background none, or its white by default.
Thanks, I should have tried this first, so many times this has bitten me.
It might be related to this:
https://www.imagemagick.org/discourse-s ... hp?t=24603
I am using opencl-nvidia for cuda in blender; just a guess, but I have it on the other machine also; the only difference I see in machines is AMD vs Intel, and its the Intel machine that is breaking, an i7.
I did need -background none, or its white by default.
Thanks, I should have tried this first, so many times this has bitten me.
Re: convert -extent not working [Solved]
Upgrading to 7 fixed it.