I have a image with X*Y size say 42*42 and I want to change the X part to 384 fixed. I have a sofware which accpets only 384*Y size of images.I can change manually the X to 384 using paint.
Open the image in paint.
press ctrl+e a windows will open with image properties
Change the Width to 384.
It adds some white space to that image. so that my original image doesnt gets altered.
My original image
http://i.stack.imgur.com/kXhet.png
altered picture
http://i.stack.imgur.com/zrH1Y.png
if you download the image then you can find the difference. My question is how can I do it using imagemagick command line.
How to change png file parameter IHDR width using imageshack
-
- Posts: 9
- Joined: 2016-08-02T03:02:48-07:00
- Authentication code: 1151
Re: How to change png file parameter IHDR width using imageshack
I suppose you mean using imagemagickHow to change png file parameter IHDR width using imageshack
You can use extent to change the image width without altering the image, and set the background to white:
Code: Select all
convert kXhet.png -background white -extent 384x42 output.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to change png file parameter IHDR width using imageshack
You can add -gravity XX to put the padding on the left, right or center (using XX = west, east or center)
Re: How to change png file parameter IHDR width using imageshack
thanks man the command worked like charm.....imagemagick community is very helpfulroipoussiere wrote:I suppose you mean using imagemagickHow to change png file parameter IHDR width using imageshack
You can use extent to change the image width without altering the image, and set the background to white:
result:Code: Select all
convert kXhet.png -background white -extent 384x42 output.png